* [PATCH v1] serial: 8250_exar: Consistently define pci_device_ids using named initializers
@ 2026-05-22 14:01 Uwe Kleine-König (The Capable Hub)
2026-07-07 9:06 ` Uwe Kleine-König (The Capable Hub)
0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-05-22 14:01 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Florian Eckert, linux-kernel, linux-serial
The .driver_data member of the struct pci_device_id array were
initialized by list expressions. This isn't easily readable if you're
not into PCI, still more given that it's hidden in macros. Using named
initializers is more explicit and thus easier to parse for a human. And
it's also more robust against changes to the struct definition.
The mentioned robustness is relevant for a planned change to struct
pci_device_id that replaces .driver_data by an anonymous union.
Also drop a few explicit zeros that are not needed and improve
indention.
This change doesn't introduce changes to the compiled pci_device_id
array. Tested on x86 and arm64.
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
drivers/tty/serial/8250/8250_exar.c | 30 ++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index c682c0d0dffa..f9a14eaa13cb 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -1642,14 +1642,14 @@ static const struct exar8250_board pbn_exar_XR17V8358 = {
.exit = pci_xr17v35x_exit,
};
-#define CTI_EXAR_DEVICE(devid, bd) { \
- PCI_DEVICE_SUB( \
- PCI_VENDOR_ID_EXAR, \
- PCI_DEVICE_ID_EXAR_##devid, \
- PCI_SUBVENDOR_ID_CONNECT_TECH, \
- PCI_ANY_ID), 0, 0, \
- (kernel_ulong_t)&bd \
- }
+#define CTI_EXAR_DEVICE(devid, bd) { \
+ PCI_DEVICE_SUB( \
+ PCI_VENDOR_ID_EXAR, \
+ PCI_DEVICE_ID_EXAR_##devid, \
+ PCI_SUBVENDOR_ID_CONNECT_TECH, \
+ PCI_ANY_ID), \
+ .driver_data = (kernel_ulong_t)&bd \
+}
#define EXAR_DEVICE(vend, devid, bd) { PCI_DEVICE_DATA(vend, devid, &bd) }
@@ -1658,18 +1658,18 @@ static const struct exar8250_board pbn_exar_XR17V8358 = {
PCI_VENDOR_ID_EXAR, \
PCI_DEVICE_ID_EXAR_##devid, \
PCI_SUBVENDOR_ID_IBM, \
- PCI_SUBDEVICE_ID_IBM_##sdevid), 0, 0, \
- (kernel_ulong_t)&bd \
- }
+ PCI_SUBDEVICE_ID_IBM_##sdevid), \
+ .driver_data = (kernel_ulong_t)&bd \
+}
#define USR_DEVICE(devid, sdevid, bd) { \
PCI_DEVICE_SUB( \
PCI_VENDOR_ID_USR, \
PCI_DEVICE_ID_EXAR_##devid, \
PCI_VENDOR_ID_EXAR, \
- PCI_SUBDEVICE_ID_USR_##sdevid), 0, 0, \
- (kernel_ulong_t)&bd \
- }
+ PCI_SUBDEVICE_ID_USR_##sdevid), \
+ .driver_data = (kernel_ulong_t)&bd \
+}
static const struct pci_device_id exar_pci_tbl[] = {
EXAR_DEVICE(ACCESSIO, COM_2S, pbn_exar_XR17C15x),
@@ -1726,7 +1726,7 @@ static const struct pci_device_id exar_pci_tbl[] = {
EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4),
EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4),
EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8),
- { 0, }
+ { }
};
MODULE_DEVICE_TABLE(pci, exar_pci_tbl);
base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1] serial: 8250_exar: Consistently define pci_device_ids using named initializers
2026-05-22 14:01 [PATCH v1] serial: 8250_exar: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
@ 2026-07-07 9:06 ` Uwe Kleine-König (The Capable Hub)
0 siblings, 0 replies; 2+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-07-07 9:06 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby; +Cc: Florian Eckert, linux-kernel, linux-serial
[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]
Hello Greg,
On Fri, May 22, 2026 at 04:01:03PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> The .driver_data member of the struct pci_device_id array were
> initialized by list expressions. This isn't easily readable if you're
> not into PCI, still more given that it's hidden in macros. Using named
> initializers is more explicit and thus easier to parse for a human. And
> it's also more robust against changes to the struct definition.
>
> The mentioned robustness is relevant for a planned change to struct
> pci_device_id that replaces .driver_data by an anonymous union.
>
> Also drop a few explicit zeros that are not needed and improve
> indention.
>
> This change doesn't introduce changes to the compiled pci_device_id
> array. Tested on x86 and arm64.
>
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Given this patch was sent around 7.1-rc5 and missed the merge window for
7.2-rc1, I wonder if you still have it on your radar?!
It still applies fine on top of next-20260706.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-07 9:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-22 14:01 [PATCH v1] serial: 8250_exar: Consistently define pci_device_ids using named initializers Uwe Kleine-König (The Capable Hub)
2026-07-07 9:06 ` Uwe Kleine-König (The Capable Hub)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox