From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: Re: [PATCH] drm/bridge: waveshare-dsi: Fix signedness bug Date: Mon, 09 Mar 2026 08:10:08 +1000 Message-ID: In-Reply-To: References: X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Correctness:** The fix is correct. By storing the return value in the alr= eady-declared `int ret` variable, the negative error check works properly. = The `else` branch assigns `dsi->lanes =3D ret` only when `ret >=3D 0`, whic= h is safe since lane counts 1=E2=80=934 fit in an unsigned int. **Commit message:** Well-written. It clearly describes the bug, the fix, in= cludes the Smatch warning output, and has appropriate `Reported-by`, `Close= s`, and `Fixes` tags. **Minor nit:** The `dev_warn` format string uses `%d` for `ret`, which is c= orrect (signed int). The original code used `%d` for `dsi->lanes` (unsigned= ), which was technically a format mismatch =E2=80=94 so the patch also inci= dentally fixes that. **Code:** ```c - dsi->lanes =3D drm_of_get_data_lanes_count_ep(dev->of_node, 0, 0, 1, 4); - if (dsi->lanes < 0) { + ret =3D drm_of_get_data_lanes_count_ep(dev->of_node, 0, 0, 1, 4); + if (ret < 0) { dev_warn(dev, "Invalid or missing DSI lane count %d, falling back to 2 l= anes\n", - dsi->lanes); + ret); dsi->lanes =3D 2; /* Old DT backward compatibility */ + } else { + dsi->lanes =3D ret; } ``` No issues found. The patch is minimal, targeted, and correct. --- Generated by Claude Code Patch Reviewer