From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: Use safer strscpy() instead of strcpy() Date: Tue, 28 Apr 2026 15:38:38 +1000 Message-ID: In-Reply-To: <20260425065926.1091168-1-aichao@kylinos.cn> References: <20260425065926.1091168-1-aichao@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: Use safer strscpy() instead of strcpy() Author: Ai Chao Patches: 22 Reviewed: 2026-04-28T15:38:38.793275 --- This is a 35-patch mechanical series (19 patches CC'd to dri-devel) replaci= ng `strcpy()` with `strscpy()` across fbdev drivers. The stated goal is cor= rect =E2=80=94 `strscpy()` is the preferred API for copying strings into fi= xed-size arrays in the modern kernel, and the kernel community has been sys= tematically driving this conversion. **All replacements are safe**: in every case, the source string literals fi= t 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 idi= omatic code replacement." 2. **Patch 05 (atafb)** modifies a commented-out line, which is pointless. 3. **Patch 03 (sisfb)** =E2=80=94 the `strbuf1` conversion is safe but subt= ly 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) <= =3D 19`. This is safe but is a genuine behavioral change =E2=80=94 `strscpy= ()` will NUL-terminate and silently truncate, where `strcpy()` would overfl= ow. 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