From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Use safer strscpy() instead of strcpy()
Date: Tue, 28 Apr 2026 15:38:38 +1000 [thread overview]
Message-ID: <review-overall-20260425065926.1091168-1-aichao@kylinos.cn> (raw)
In-Reply-To: <20260425065926.1091168-1-aichao@kylinos.cn>
Overall Series Review
Subject: Use safer strscpy() instead of strcpy()
Author: Ai Chao <aichao@kylinos.cn>
Patches: 22
Reviewed: 2026-04-28T15:38:38.793275
---
This is a 35-patch mechanical series (19 patches CC'd to dri-devel) replacing `strcpy()` with `strscpy()` across fbdev drivers. The stated goal is correct — `strscpy()` is the preferred API for copying strings into fixed-size arrays in the modern kernel, and the kernel community has been systematically driving this conversion.
**All replacements are safe**: in every case, the source string literals fit comfortably within their destination buffers (`fb_fix_screeninfo.id` is `char[16]`, `i2c_adapter.name` is `char[48]`, SiS `myid` is `char[40]`, etc.). The `strscpy()` 2-argument form (destination size inferred via `sizeof`) works correctly here because the destinations are all arrays, not pointers.
**Issues found:**
1. **Patch 02 (i810)** silently changes indentation from spaces to tabs on the modified lines, which contradicts the commit message claim of "only idiomatic code replacement."
2. **Patch 05 (atafb)** modifies a commented-out line, which is pointless.
3. **Patch 03 (sisfb)** — the `strbuf1` conversion is safe but subtly different from the rest of the series: it copies from a variable `name` (not a string literal) into `char strbuf1[20]`, guarded by `strlen(name) <= 19`. This is safe but is a genuine behavioral change — `strscpy()` will NUL-terminate and silently truncate, where `strcpy()` would overflow. Worth noting in the commit message.
4. The patches did not apply cleanly, suggesting some of these conversions may already exist upstream.
5. A 35-patch series for trivial s/strcpy/strscpy/ is arguably excessive; a Coccinelle spatch would be more appropriate and reviewable.
**Verdict**: Low-risk mechanical cleanup. Correct in substance, with minor nits on patches 02, 03, and 05.
---
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-04-28 5:38 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 6:58 [PATCH 00/35] Use safer strscpy() instead of strcpy() Ai Chao
2026-04-25 6:58 ` [PATCH 01/35] fbdev: matroxfb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 02/35] fbdev: i810: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 03/35] fbdev: sisfb: " Ai Chao
2026-04-25 8:08 ` Helge Deller
2026-04-25 11:02 ` David Laight
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 04/35] fbdev: geode: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 05/35] fbdev: atafb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 06/35] fbdev: tdfxfb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 07/35] fbdev: pm2fb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:58 ` [PATCH 08/35] fbdev: xen-fbfront: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 09/35] fbdev: controlfb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 10/35] fbdev: stifb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 11/35] fbdev: fm2fb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 12/35] fbdev: arkfb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 13/35] fbdev: vt8500lcdfb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 14/35] fbdev: vt8623fb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 15/35] fbdev: gbefb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 16/35] fbdev: wm8505fb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 17/35] fbdev: rivafb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 18/35] fbdev: sh7760fb: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-25 6:59 ` [PATCH 19/35] fbdev: savage: " Ai Chao
2026-04-28 5:38 ` Claude review: " Claude Code Review Bot
2026-04-28 5:38 ` 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-20260425065926.1091168-1-aichao@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