Re: [PATCH] scsi: Consistently define pci_device_ids using named initializers
Uwe Kleine-König (The Capable Hub) <[email protected]> Tue, 9 Jun 2026 17:34:38 +0200
| Newsgroups | org.kernel.vger.target-devel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-scsi |
|---|---|
| Message-ID | <aigySpryV0ptiBqr@monoceros> |
[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/[email protected]/) > 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) <[email protected]> > --- > 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
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmooMooACgkQj4D7WH0S /k7rYAf7BB8NfldywKX4tj4A6aBVySOEe2C7pUP1TdlEr3w19ARcaTKXslkG4Ehf 3bsCMPQMhEjQaFnmd8qLPqLJt7H4tBDoXphJO2ydmt4pKJ6GYA+aIZsUPyLhlcYN Jj44sLl6uuougfkZ95xMlkV8BqwoumkQkJXzshYIWXOUTGs474POTHB51QdoEfCX 2I7X6sEy9N7YYtshmD4o40fj3dRxxemVfdbpwWAnAD2p7UK8K/IG1l+IbG3Znp/L 1UFRAw/ukBk7IxkxA/RUDCc7jMor+/X6AkLLF+r3TLvnblpL8CEO2yaXmqNhEiBT vWE5iW6MuwrRCxfKUVsBadNfYqvblQ== =uDdw -----END PGP SIGNATURE-----