From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: treewide: Convert custom kernel_param_ops .get callbacks to seq_buf via cocci Date: Mon, 25 May 2026 20:11:18 +1000 Message-ID: In-Reply-To: <20260521133326.2465264-9-kees@kernel.org> References: <20260521133315.work.845-kees@kernel.org> <20260521133326.2465264-9-kees@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review Coccinelle-generated conversions of callbacks that end with a single `scnpr= intf`/`sprintf`/`sysfs_emit` return. The Coccinelle rule is shown and is co= rrect. **Bug: `drivers/acpi/ec.c` `param_get_event_clearing`** =E2=80=94 The conve= rted code has an unreachable `return 0;` after the switch: ```c + default: + seq_buf_printf(buffer, "invalid\n"); + return 0; } return 0; } ``` Since every case (including `default`) now returns 0 explicitly, the `retur= n 0;` after the closing `}` of the switch is dead code. This isn't a bug pe= r se (it was already dead code in the original with the `return sprintf(...= )` statements), but the Coccinelle script didn't clean it up. The compiler = will likely elide it. **Cosmetic only.** The `drm_panic.c` change is straightforward: ```c -static int drm_panic_type_get(char *buffer, const struct kernel_param *kp) +static int drm_panic_type_get(struct seq_buf *buffer, + const struct kernel_param *kp) { - return scnprintf(buffer, PAGE_SIZE, "%s\n", - drm_panic_type_map[drm_panic_type]); + seq_buf_printf(buffer, "%s\n", drm_panic_type_map[drm_panic_type]); + return 0; } ``` Correct. **Verdict: Mechanical, correct. One cosmetic dead-code artifact in `drivers= /acpi/ec.c`.** --- Generated by Claude Code Patch Reviewer