From: Claude Code Review Bot <claude-review@example.com>
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 [thread overview]
Message-ID: <review-overall-20260522091910.3276524-1-jindongyang@kylinos.cn> (raw)
In-Reply-To: <20260522091910.3276524-1-jindongyang@kylinos.cn>
Overall Series Review
Subject: drm/amdgpu/jpeg: Fix format-truncation warning in jpeg_v2_5_sw_init()
Author: Dongyang Jin <jindongyang@kylinos.cn>
Patches: 1
Reviewed: 2026-05-25T19:07:47.282791
---
This is a single-patch series that fixes a `-Wformat-truncation` compiler warning 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 = 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 the 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 — well within the buffer.
**Verdict: Looks good.** The fix is minimal, correct, and addresses the root cause rather than papering over it with a cast or pragma. One minor style nit below.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-05-25 9:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-22 9:19 [PATCH] drm/amdgpu/jpeg: Fix format-truncation warning in jpeg_v2_5_sw_init() Dongyang Jin
2026-05-25 9:07 ` Claude review: " Claude Code Review Bot
2026-05-25 9:07 ` Claude Code Review Bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-overall-20260522091910.3276524-1-jindongyang@kylinos.cn \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox