From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/imagination: Define packed BVNCs in the uapi
Date: Sun, 22 Mar 2026 03:38:20 +1000 [thread overview]
Message-ID: <review-patch1-20260320-bvnc-cleanup-v2-1-49c3c1453289@imgtec.com> (raw)
In-Reply-To: <20260320-bvnc-cleanup-v2-1-49c3c1453289@imgtec.com>
Patch Review
**Overall:** Good cleanup. The approach of defining the bit layout once in the UAPI and referencing it everywhere is the right pattern.
**UAPI additions look correct:**
```c
#define DRM_PVR_BVNC_B __GENMASK_ULL(63, 48)
#define DRM_PVR_BVNC_V __GENMASK_ULL(47, 32)
#define DRM_PVR_BVNC_N __GENMASK_ULL(31, 16)
#define DRM_PVR_BVNC_C __GENMASK_ULL(15, 0)
```
These correctly match the previously documented layout. Using `__GENMASK_ULL` (the double-underscore UAPI-safe variant) is correct for a UAPI header, and the new `#include <linux/bits.h>` provides it.
**The `__PVR_PACKED_BVNC` helper pattern is clever:**
```c
#define __PVR_PACKED_BVNC(prep, b, v, n, c) \
(prep(DRM_PVR_BVNC_B, b) | \
prep(DRM_PVR_BVNC_V, v) | \
prep(DRM_PVR_BVNC_N, n) | \
prep(DRM_PVR_BVNC_C, c))
```
Parameterizing on the prep function to support both `FIELD_PREP` (runtime) and `FIELD_PREP_CONST` (compile-time) avoids code duplication while addressing the v1 build issue where `FIELD_PREP` couldn't be used in `case` labels.
**Include change is correct:** Replacing `<linux/bits.h>` with `<linux/bitfield.h>` in `pvr_device.h` is appropriate since `bitfield.h` pulls in `bits.h` transitively and `FIELD_PREP`/`FIELD_GET` are now used.
**`packed_bvnc_to_pvr_gpu_id()` conversion looks correct:**
```c
gpu_id->b = FIELD_GET(DRM_PVR_BVNC_B, bvnc);
```
This is equivalent to the previous `(bvnc & GENMASK_ULL(63, 48)) >> 48` and is more readable.
**Minor nit:** The `__PVR_PACKED_BVNC` macro uses a leading double-underscore name. While this is common for internal helper macros in the kernel, it's technically in the compiler-reserved namespace. This is a style nit, not a blocking issue — the kernel uses this convention extensively.
**No issues found.** Reviewed-by worthy.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-03-21 17:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-20 15:22 [PATCH v2 0/2] drm/imagination: GPU_ID-related cleanups Matt Coster
2026-03-20 15:22 ` [PATCH v2 1/2] drm/imagination: Define packed BVNCs in the uapi Matt Coster
2026-03-21 17:38 ` Claude Code Review Bot [this message]
2026-03-20 15:22 ` [PATCH v2 2/2] drm/imagination: Add PVR_GPU_ID_FMT to format pvr_gpu_id Matt Coster
2026-03-21 17:38 ` Claude review: " Claude Code Review Bot
2026-03-21 17:38 ` Claude review: drm/imagination: GPU_ID-related cleanups 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-20260320-bvnc-cleanup-v2-1-49c3c1453289@imgtec.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