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/panel: jadard-jd9365da-h3: Fix signedness bug Date: Tue, 05 May 2026 12:04:55 +1000 Message-ID: In-Reply-To: <20260429024954.697411-1-ethantidmore06@gmail.com> References: <20260429024954.697411-1-ethantidmore06@gmail.com> <20260429024954.697411-1-ethantidmore06@gmail.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Correctness: Good.** The fix properly introduces a signed `int ret` intermediate variable to catch the negative error code before assigning to the unsigned `dsi->lanes`: ```c - dsi->lanes = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4); - if (dsi->lanes < 0) - return dsi->lanes; + ret = drm_of_get_data_lanes_count_remote(dsi->dev.of_node, 0, -1, 2, 4); + if (ret < 0) + return ret; + dsi->lanes = ret; ``` This is the standard kernel pattern: store into a signed variable, check for error, then assign to the unsigned field only on success. The `ret` variable should already be declared in this probe function (standard for probe functions returning `int`). **Commit message: Good.** The message clearly explains the bug, includes the Smatch warning output, and has an appropriate `Fixes:` tag referencing the commit that introduced the problematic code. **Minor nit:** There's a spurious blank line added between `dsi->lanes = ret;` and `if (dsi->lanes == 4)`: ```c + dsi->lanes = ret; + if (dsi->lanes == 4) { ``` This is not wrong, but the original code had no blank line here, and the `if (dsi->lanes == 4)` check is logically tightly coupled to the lanes assignment. It would be slightly cleaner without the extra blank line, though this is a very minor style point and not worth blocking the patch over. **Verdict:** Reviewed-by worthy. The fix is correct and addresses a real bug where error codes from `drm_of_get_data_lanes_count_remote()` would be silently converted to a large unsigned value, causing the driver to proceed with a bogus lane count instead of returning an error. --- Generated by Claude Code Patch Reviewer