From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: fbdev: Consistently define pci_device_ids using named initializers Date: Tue, 05 May 2026 10:30:11 +1000 Message-ID: In-Reply-To: <20260430111637.211336-2-u.kleine-koenig@baylibre.com> References: <20260430111637.211336-2-u.kleine-koenig@baylibre.com> <20260430111637.211336-2-u.kleine-koenig@baylibre.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **Minor observations (non-blocking):** 1. **nvidia/nvidia.c =E2=80=94 `PCI_DEVICE` with `PCI_ANY_ID`**: The conver= sion is semantically correct: ```c - {PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, - PCI_BASE_CLASS_DISPLAY << 16, 0xff0000, 0}, + { + PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID), + .class =3D PCI_BASE_CLASS_DISPLAY << 16, + .class_mask =3D 0xff0000 + }, ``` `PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID)` works because PCI matching t= reats `PCI_ANY_ID` in the device field as a wildcard. However, `PCI_DEVICE_= CLASS()` would be a more semantically precise choice here, since this entry= really matches by vendor + display class, not by a specific device. That s= aid, `PCI_DEVICE_CLASS` sets vendor to `PCI_ANY_ID` too, so it would change= the semantics (broadening the match beyond NVIDIA). The current conversion= preserves the original behavior, which is the right call. 2. **riva/fbdev.c =E2=80=94 `PCI_DEVICE` instead of `PCI_VDEVICE`**: All ri= va entries use `PCI_DEVICE(PCI_VENDOR_ID_XXX, ...)` rather than `PCI_VDEVIC= E(XXX, ...)`. This is because the first entry uses `PCI_VENDOR_ID_NVIDIA_SG= S` (a different vendor from the rest), so `PCI_DEVICE` was chosen for unifo= rmity across the table. Reasonable stylistic choice. 3. **pm3fb.c =E2=80=94 device ID formatting**: ```c - { PCI_VENDOR_ID_3DLABS, 0x0a, + { PCI_VDEVICE(3DLABS, 0x000a) }, ``` The value change from `0x0a` to `0x000a` is cosmetic (same value), but it's= a nice touch to normalize to 4-digit hex for consistency with PCI device I= D conventions. 4. **sis/sis_main.h =E2=80=94 explicit `.driver_data =3D 0`**: The SIS_300 = entry explicitly sets `.driver_data =3D 0`: ```c + { PCI_VDEVICE(SI, PCI_DEVICE_ID_SI_300), .driver_data =3D 0 }, ``` This is slightly redundant since `PCI_VDEVICE` already zeros the subsequent= fields via its trailing `0, 0`, and the struct is zero-initialized. Howeve= r, it does improve readability by making the indexing scheme explicit when = other entries in the same table use non-zero `driver_data` values (1 throug= h 11). Good call. 5. **matroxfb_base.c =E2=80=94 local `PCI_DEVICE` to `PCI_VDEVICE` in stack= variable**: The `intel_82437` local array inside `initMatrox2()` is conver= ted: ```c - { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82437) }, + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_82437) }, ``` This is correct and equivalent since `driver_data` is unused. 6. **Style consistency**: The patch uses two formatting styles for entries = with `driver_data`: - Single-line: `{ PCI_VDEVICE(ATI, ...), .driver_data =3D rage_M3 },` (a= ty128fb, neofb, s3fb) - Multi-line with `}, {` continuation: `PCI_VDEVICE(...),\n.driver_data = =3D ...,\n}, {` (cyber2000fb, savagefb, tdfxfb) This isn't an issue =E2=80=94 the multi-line form is used when the line = would be too long otherwise =E2=80=94 but worth noting for consistency if t= he maintainer has a preference. 7. **Missing trailing comma in nvidia.c**: The last field in the nvidia ent= ry lacks a trailing comma: ```c + .class_mask =3D 0xff0000 + }, ``` While not a bug (it's the last field before the `}`), adding a trailing com= ma (`.class_mask =3D 0xff0000,`) is more consistent with kernel style and w= ould make future additions cleaner. The geode/gx1fb_core.c conversion does = include the trailing comma by contrast. **No correctness issues found.** The patch is a clean mechanical transforma= tion that preserves the compiled output. The use of `PCI_VDEVICE` vs `PCI_D= EVICE` is appropriate in each case, and the class-match conversions (nvidia= , tdfxfb, gx1fb) correctly use named `.class` / `.class_mask` fields. --- Generated by Claude Code Patch Reviewer