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: Manually convert custom kernel_param_ops .get callbacks
Date: Mon, 25 May 2026 20:11:18 +1000	[thread overview]
Message-ID: <review-patch10-20260521133326.2465264-10-kees@kernel.org> (raw)
In-Reply-To: <20260521133326.2465264-10-kees@kernel.org>

Patch Review

These are the callbacks the Coccinelle script couldn't handle — ones that do multi-step string construction, pass the buffer through helper functions, or use `strcpy`/`memcpy`.

**`drivers/gpu/drm/i915/i915_mitigations.c`**: The conversion is well done. The trailing-comma-to-newline replacement now guards against overflow:

```c
+	if (!seq_buf_has_overflowed(buffer) && buffer->len > 0 &&
+	    buffer->buffer[buffer->len - 1] == ',')
+		buffer->buffer[buffer->len - 1] = '\n';
```

This is an improvement over the old code which unconditionally wrote `buffer[count - 1] = '\n'`.

**`drivers/char/ipmi/ipmi_watchdog.c`**: The `get_param_str` rework is notable — the old code called `fn(NULL, buffer)`, checked for errors, then appended a newline. The new code just calls `fn(NULL, buffer)` and returns its result. The newline is now appended inside `action_op`/`preaction_op`/`preop_op` themselves via `seq_buf_printf(outval, "%s\n", ...)`. This is correct — the newline responsibility is pushed into the individual ops.

**`drivers/acpi/sysfs.c`**: The multi-line debug layer/level output is nicely simplified — no more manual offset tracking.

**`drivers/scsi/fcoe/fcoe_transport.c`**: Small behavioral improvement — the old code used `IFNAMSIZ` as the buffer limit per transport name which was arbitrary; the new code relies on seq_buf's natural bounds. The empty-list "none" case was restructured to use an explicit `list_empty()` check instead of checking whether anything was written. Correct.

**`lib/dynamic_debug.c`**: Note that `param_get_dyndbg_classes()` still returns `-1` in the default case rather than a proper `-errno`. This is pre-existing and not introduced by this patch, but it's worth noting.

**Verdict: Well-done manual conversions. No correctness issues.**

---
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 review: " Claude Code Review Bot
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 Code Review Bot [this message]
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-patch10-20260521133326.2465264-10-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