public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
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	[thread overview]
Message-ID: <review-patch9-20260521133326.2465264-9-kees@kernel.org> (raw)
In-Reply-To: <20260521133326.2465264-9-kees@kernel.org>

Patch Review

Coccinelle-generated conversions of callbacks that end with a single `scnprintf`/`sprintf`/`sysfs_emit` return. The Coccinelle rule is shown and is correct.

**Bug: `drivers/acpi/ec.c` `param_get_event_clearing`** — The converted 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 `return 0;` after the closing `}` of the switch is dead code. This isn't a bug per 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

  parent reply	other threads:[~2026-05-25 10:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-21 13:33 [PATCH 00/11] Convert moduleparams to seq_buf Kees Cook
2026-05-21 13:33 ` [PATCH 01/11] params: bound array element output to the caller's page buffer Kees Cook
2026-05-21 16:46   ` David Laight
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 02/11] panic: Replace panic_print_get() with generic helper Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 03/11] moduleparam: Add DEFINE_KERNEL_PARAM_OPS macro family Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 04/11] treewide: Convert struct kernel_param_ops initializers to DEFINE_KERNEL_PARAM_OPS Kees Cook
2026-05-21 13:59   ` Sean Christopherson
2026-05-22 17:01   ` Rafael J. Wysocki
2026-05-23  0:38   ` SeongJae Park
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 05/11] moduleparam: Rename .get field to .get_str Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 06/11] moduleparam: Add seq_buf-based .get callback alongside .get_str Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 07/11] moduleparam: Route DEFINE_KERNEL_PARAM_OPS get pointer via _Generic Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 08/11] params: Convert generic kernel_param_ops .get helpers to seq_buf Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 09/11] treewide: Convert custom kernel_param_ops .get callbacks to seq_buf via cocci Kees Cook
2026-05-21 13:45   ` Sean Christopherson
2026-05-22 17:03   ` Rafael J. Wysocki
2026-05-23  0:45   ` SeongJae Park
2026-05-25 10:11   ` Claude Code Review Bot [this message]
2026-05-21 13:33 ` [PATCH 10/11] treewide: Manually convert custom kernel_param_ops .get callbacks Kees Cook
2026-05-21 17:44   ` Jani Nikula
2026-05-22 17:05   ` Rafael J. Wysocki
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-21 13:33 ` [PATCH 11/11] moduleparam: Drop legacy kernel_param_ops .get_str field and dispatch logic Kees Cook
2026-05-25 10:11   ` Claude review: " Claude Code Review Bot
2026-05-25 10:11 ` Claude review: Convert moduleparams to seq_buf 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-patch9-20260521133326.2465264-9-kees@kernel.org \
    --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