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: drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig
Date: Tue, 28 Apr 2026 14:35:26 +1000	[thread overview]
Message-ID: <review-patch1-20260427-gpuvm-config-v1-1-8ece03771f8a@google.com> (raw)
In-Reply-To: <20260427-gpuvm-config-v1-1-8ece03771f8a@google.com>

Patch Review

**Kconfig addition** (`drivers/gpu/drm/Kconfig`):

```
+config RUST_DRM_GPUVM
+	bool
+	depends on DRM
+	select DRM_GPUVM
+	help
+	  Choose this if you need GPUVM functions in Rust
```

This correctly mirrors the existing `RUST_DRM_GEM_SHMEM_HELPER` pattern at line 278. Key points:
- `bool` (not `tristate`) — forces built-in, which is the whole point.
- `select DRM_GPUVM` — ensures the C implementation is pulled in when selected.
- No user-visible prompt (no string after `bool`) — intended to be selected by drivers, not manually enabled. This is correct.

One minor observation: `DRM_GPUVM` is `tristate`, and `RUST_DRM_GPUVM` is `bool` that selects it. When a `bool` symbol selects a `tristate`, Kconfig forces the tristate to `y` (built-in). This is exactly the desired behavior and matches the commit message explanation.

**C helper guard change** (`rust/helpers/drm_gpuvm.c`):

```c
-#ifdef CONFIG_DRM_GPUVM
+#ifdef CONFIG_RUST_DRM_GPUVM
```

Correct. The helper functions are only needed for Rust consumers, so guarding them behind `RUST_DRM_GPUVM` rather than `DRM_GPUVM` avoids compiling them when only C code uses GPUVM (where the inline/macro versions are used directly). The closing comment is also updated consistently.

**Rust cfg change** (`rust/kernel/drm/gpuvm/mod.rs`):

```rust
-#![cfg(CONFIG_DRM_GPUVM = "y")]
+#![cfg(CONFIG_RUST_DRM_GPUVM)]
```

Two things happen here:
1. The config symbol is updated to match the new Kconfig option.
2. The `= "y"` check is dropped. Since `RUST_DRM_GPUVM` is `bool` (never `m`), a bare `cfg(CONFIG_RUST_DRM_GPUVM)` is sufficient — it will be either defined or not. This is consistent with how other `bool` configs are checked elsewhere in `rust/kernel/` (e.g., `#![cfg(CONFIG_MMU)]`).

**Overall**: Clean, minimal patch. Follows established conventions. No issues found.

Reviewed-by: Claude <noreply@anthropic.com>

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-04-28  4:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27 10:54 [PATCH] drm/gpuvm: rust: add RUST_DRM_GPUVM option to Kconfig Alice Ryhl
2026-04-28  4:35 ` Claude Code Review Bot [this message]
2026-04-28  4:35 ` Claude review: " 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-patch1-20260427-gpuvm-config-v1-1-8ece03771f8a@google.com \
    --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