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-patch1-20260522091910.3276524-1-jindongyang@kylinos.cn> (raw)
In-Reply-To: <20260522091910.3276524-1-jindongyang@kylinos.cn>
Patch Review
**Status: Acceptable (minor nit)**
**The type change is well-motivated and correct.** Since `adev->jpeg.num_jpeg_inst` is `uint8_t` (from `amdgpu_jpeg.h:132`), narrowing the loop variable to match is a natural fix. A `uint8_t` value formatted with `%u` produces at most 3 characters ("255"), so `"jpeg_dec_255\0"` = 13 bytes, which comfortably 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 = ip_block->adev;
```
This is fine and follows the existing pattern in the file of grouping declarations by type. No issue here.
**One consideration:** The `harvest_config` mask expression `(1 << i)` at line 112 and 143 is safe with `uint8_t i` — `i` gets integer-promoted and the shift is well-defined for values 0–255 (though in practice `num_jpeg_inst` is small, typically 1–2).
**No functional concerns.** The patch is minimal and solves exactly the reported problem.
Reviewed-by recommendation: **Acceptable as-is.**
---
Generated by Claude Code Patch Reviewer
next 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 Code Review Bot [this message]
2026-05-25 9:07 ` Claude review: " Claude Code Review Bot
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-patch1-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