From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: verisilicon: make vs_format conversion function return int
Date: Wed, 11 Feb 2026 16:24:25 +1000 [thread overview]
Message-ID: <review-patch1-20260210141300.749013-2-zhengxingda@iscas.ac.cn> (raw)
In-Reply-To: <20260210141300.749013-2-zhengxingda@iscas.ac.cn>
Patch Review
**Purpose:** Convert `drm_format_to_vs_format()` from void to int return type to enable error reporting.
**Code Analysis:**
```c
-void drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format)
+int drm_format_to_vs_format(u32 drm_format, struct vs_format *vs_format)
```
This is a straightforward API change. The function signature update is correct.
```c
default:
- pr_warn("Unexpected drm format!\n");
+ return -EINVAL;
}
```
**Issue 1 - Error handling improvement:**
Good: Replacing a warning with proper error propagation is correct. However, it would be better to log which format was unexpected for debugging:
```c
default:
pr_err("Unsupported drm format: 0x%08x\n", drm_format);
return -EINVAL;
```
```c
/* N/A for non-YUV formats */
vs_format->uv_swizzle = false;
+
+ return 0;
}
```
**Issue 2 - Success path:**
The success return is only at the very end. This means if the first switch statement matches a format, but execution continues through the second switch, we always return 0. This appears correct since the default case in the first switch would have returned -EINVAL already. However, this creates implicit coupling between the two switch statements that should be documented.
**Issue 3 - Header includes:**
```c
+#include <drm/drm_atomic_state_helper.h>
```
This include appears unrelated to this patch's functionality (making the function return int). It's likely needed for patch 2 or 3 but was mistakenly added here. This breaks the logical separation of changes and could cause bisection issues.
**Verdict:** The core change is correct, but has header inclusion and error message issues.
---
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-11 6:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-10 14:12 [PATCH drm-misc-next 0/3] drm: verisilicon: convert drm_format to vs_format in atomic_check Icenowy Zheng
2026-02-10 14:12 ` [PATCH drm-misc-next 1/3] drm: verisilicon: make vs_format conversion function return int Icenowy Zheng
2026-02-11 6:24 ` Claude Code Review Bot [this message]
2026-02-10 14:12 ` [PATCH drm-misc-next 2/3] drm: verisilicon: subclass drm_plane_state Icenowy Zheng
2026-02-11 6:24 ` Claude review: " Claude Code Review Bot
2026-02-10 14:13 ` [PATCH drm-misc-next 3/3] drm: verisilicon: fill plane's vs_format in atomic_check Icenowy Zheng
2026-02-11 6:24 ` Claude review: " Claude Code Review Bot
2026-02-11 6:24 ` Claude review: drm: verisilicon: convert drm_format to " Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch1-20260210141300.749013-2-zhengxingda@iscas.ac.cn \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox