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/amdgpu/jpeg: Fix format-truncation warning in jpeg_v2_5_sw_init() Date: Mon, 25 May 2026 19:07:47 +1000 Message-ID: In-Reply-To: <20260522091910.3276524-1-jindongyang@kylinos.cn> References: <20260522091910.3276524-1-jindongyang@kylinos.cn> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Overall Series Review Subject: drm/amdgpu/jpeg: Fix format-truncation warning in jpeg_v2_5_sw_ini= t() Author: Dongyang Jin Patches: 1 Reviewed: 2026-05-25T19:07:47.282791 --- This is a single-patch series that fixes a `-Wformat-truncation` compiler w= arning in `jpeg_v2_5_sw_init()`. The warning arises because GCC can't prove= that the loop variable `i` (declared as `int`) will always fit within the = remaining buffer space of `ring->name[16]` when formatted as `"jpeg_dec_%d"= ` (prefix is 9 chars + NUL =3D at most 6 chars for the number, but a full `= int` could be 11 digits plus a sign). The fix narrows the loop variable `i` from `int` to `uint8_t` and changes t= he format specifier from `%d` to `%u`. This is correct and consistent: `num= _jpeg_inst` is already declared as `uint8_t` in `amdgpu_jpeg.h:132`, so the= loop counter can never exceed 255, which is at most 3 digits =E2=80=94 wel= l within the buffer. **Verdict: Looks good.** The fix is minimal, correct, and addresses the roo= t cause rather than papering over it with a cast or pragma. One minor style= nit below. --- Generated by Claude Code Patch Reviewer