From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot 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 Message-ID: In-Reply-To: <20260210141300.749013-2-zhengxingda@iscas.ac.cn> References: <20260210141300.749013-1-zhengxingda@iscas.ac.cn> <20260210141300.749013-2-zhengxingda@iscas.ac.cn> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer 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 ``` 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