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> <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 Patch Review **Status: Acceptable (minor nit)** **The type change is well-motivated and correct.** Since `adev->jpeg.num_jp= eg_inst` is `uint8_t` (from `amdgpu_jpeg.h:132`), narrowing the loop variab= le to match is a natural fix. A `uint8_t` value formatted with `%u` produce= s at most 3 characters ("255"), so `"jpeg_dec_255\0"` =3D 13 bytes, which c= omfortably fits in `ring->name[16]`. **The format specifier change from `%d` to `%u` is correct:** ```c snprintf(ring->name, sizeof(ring->name), "jpeg_dec_%u", i); ``` Since `i` is now unsigned, `%u` is the matching specifier. Good. **Minor style nit:** The declaration ordering changed slightly: ```c struct amdgpu_ring *ring; uint8_t i; int r; struct amdgpu_device *adev =3D ip_block->adev; ``` This is fine and follows the existing pattern in the file of grouping decla= rations by type. No issue here. **One consideration:** The `harvest_config` mask expression `(1 << i)` at l= ine 112 and 143 is safe with `uint8_t i` =E2=80=94 `i` gets integer-promote= d and the shift is well-defined for values 0=E2=80=93255 (though in practic= e `num_jpeg_inst` is small, typically 1=E2=80=932). **No functional concerns.** The patch is minimal and solves exactly the rep= orted problem. Reviewed-by recommendation: **Acceptable as-is.** --- Generated by Claude Code Patch Reviewer