Re: [PATCH] scsi: Consistently define pci_device_ids using named initializers
From: Uwe Kleine-König (The Capable Hub)
Date: Tue Jun 09 2026 - 11:45:50 EST
[Dropping Bradley Grove and Michael Reed from Cc: as their addresses
bounced]
On Wed, Apr 29, 2026 at 12:18:20PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> ... and PCI device helpers.
>
> The various struct pci_device_id arrays were initialized mostly by one
> of the PCI_DEVICE macros and then list expressions. The latter isn't
> easily readable if you're not into PCI. Using named initializers is more
> explicit and thus easier to parse.
>
> Also use PCI_DEVICE* helper macros to assign .vendor, .device,
> .subvendor and .subdevice where appropriate and skip explicit
> assignments of 0 (which the compiler takes care of).
>
> The secret plan is to make struct pci_device_id::driver_data an
> anonymous union (similar to
> https://lore.kernel.org/all/cover.1776579304.git.u.kleine-koenig@xxxxxxxxxxxx/)
> and that requires named initializers. But it's also a nice cleanup on
> its own.
>
> This change doesn't introduce changes to the compiled pci_device_id
> arrays. Tested on x86 and arm64.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
> ---
> Hello,
>
> the mentioned follow-up quest allows to do
>
> - { PCI_VDEVICE(TTI, 0x3220), .driver_data = (kernel_ulong_t)&hptiop_itl_ops },
> + { PCI_VDEVICE(TTI, 0x3220), .driver_data_ptr = &hptiop_itl_ops },
>
> which gets rid of a bunch of casts and so brings a little bit more type
> safety. This patch is a preparation for that.
>
> I assume a single patch for all of drivers/scsi is fine. If not I can
> split per driver.
Is this patch still on someone's radar?
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature