From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm: uapi: Add macro for chipset specific event ID region
Date: Sun, 12 Apr 2026 12:13:17 +1000 [thread overview]
Message-ID: <review-patch1-20260408163608.361826-2-bence.csokas@arm.com> (raw)
In-Reply-To: <20260408163608.361826-2-bence.csokas@arm.com>
Patch Review
**Value correctness — OK**
All conversions are value-preserving:
- `DRM_EXYNOS_G2D_EVENT`: `0x0 | 0x80000000 = 0x80000000` (was `0x80000000`) ✓
- `DRM_EXYNOS_IPP_EVENT`: `0x2 | 0x80000000 = 0x80000002` (was `0x80000002`) ✓
- `VIRTGPU_EVENT_FENCE_SIGNALED`: `0x10000000 | 0x80000000 = 0x90000000` (was `0x90000000`) ✓
- `DRM_VMW_EVENT_FENCE_SIGNALED`: `0x0 | 0x80000000 = 0x80000000` (was `0x80000000`) ✓
**Missing conversion — nouveau_drm.h**
```c
/* nouveau_drm.h line 28 */
#define DRM_NOUVEAU_EVENT_NVIF 0x80000000
```
This is a vendor-specific event at `0x80000000` that was not converted. The cause is likely the include ordering in `nouveau_drm.h`:
```c
/* line 28 */ #define DRM_NOUVEAU_EVENT_NVIF 0x80000000
/* line 30 */ #include "drm.h"
```
The macro isn't defined yet at line 28. The fix would be to move the `#include "drm.h"` above the define, or move the define below the include. Either way, this omission should be mentioned in the commit message, or better yet, fixed as part of this patch.
**Comment update opportunity**
The existing comment at `drm.h:1387`:
```c
* Event types 0 - 0x7fffffff are generic DRM events, 0x80000000 and
* up are chipset specific.
```
could be updated to reference the new `DRM_EVENT_VENDOR_SPECIFIC()` macro, reinforcing the link between the comment and the code it describes. This is optional but would improve discoverability.
**Macro design — minor concern**
```c
#define DRM_EVENT_VENDOR_SPECIFIC(_v) ((_v) | 0x80000000)
```
The OR operation doesn't guard against a caller passing a value that already has bit 31 set (e.g., `DRM_EVENT_VENDOR_SPECIFIC(0x80000000)` would produce `0x80000000`, silently masking a likely error). For UAPI this is probably fine — adding `BUILD_BUG_ON` style validation would be impractical in a header — but it's worth noting.
**Naming**
`DRM_EVENT_VENDOR_SPECIFIC` reads somewhat like a constant rather than a function-like macro. Names like `DRM_EVENT_VENDOR(_v)` or `DRM_VENDOR_EVENT(_v)` might be slightly more conventional, but this is a subjective style point and the current name is descriptive enough.
**Summary**: The patch is a net improvement in code clarity. The missing `nouveau_drm.h` conversion is the main issue — it should either be included (with the necessary include reorder) or explicitly explained in the commit message. With that addressed, the patch looks ready.
---
Generated by Claude Code Patch Reviewer
prev parent reply other threads:[~2026-04-12 2:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 16:36 [PATCH] drm: uapi: Add macro for chipset specific event ID region Bence Csokas
2026-04-12 2:13 ` Claude review: " Claude Code Review Bot
2026-04-12 2:13 ` Claude Code Review Bot [this message]
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-20260408163608.361826-2-bence.csokas@arm.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