mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH RESEND] gpib: Initialize pci_device_ids using PCI_DEVICE macros
@ 2026-06-29 16:54 Uwe Kleine-König (The Capable Hub)
  2026-07-17 10:22 ` Uwe Kleine-König (The Capable Hub)
  0 siblings, 1 reply; 2+ messages in thread
From: Uwe Kleine-König (The Capable Hub) @ 2026-06-29 16:54 UTC (permalink / raw)
  To: Dave Penkler, Greg Kroah-Hartman; +Cc: linux-kernel

The PCI_DEVICE macro and its variants allow to initialize the first four
members of a struct pci_device_id in a bit more compact form and also
with an easier to grasp semantic. Explicit zeros are not needed, the
compiler fills these in automatically.

So convert all array members to such a macro and drop unneeded zeros.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
---
Hello,

this patch was sent already earlier[1], I was asked to include Greg in
the to list, so here comes a resend.

Given that adding Greg to the list of recipients seems to be necessary,
it would be great if Greg also appeared in

	$ scripts/get_maintainer.pl -f drivers/gpib
	Dave Penkler <dpenkler@gmail.com> (maintainer:GPIB DRIVERS)
	linux-kernel@vger.kernel.org (open list)

Best regards
Uwe

[1] https://lore.kernel.org/lkml/20260506152424.2455439-2-u.kleine-koenig@baylibre.com

 drivers/gpib/agilent_82350b/agilent_82350b.c |  9 ++++-----
 drivers/gpib/cb7210/cb7210.c                 |  8 ++++----
 drivers/gpib/cec/cec_gpib.c                  |  4 ++--
 drivers/gpib/ines/ines_gpib.c                | 21 ++++++++++++--------
 4 files changed, 23 insertions(+), 19 deletions(-)

diff --git a/drivers/gpib/agilent_82350b/agilent_82350b.c b/drivers/gpib/agilent_82350b/agilent_82350b.c
index 9787c09faad8..490d44ad1b50 100644
--- a/drivers/gpib/agilent_82350b/agilent_82350b.c
+++ b/drivers/gpib/agilent_82350b/agilent_82350b.c
@@ -839,11 +839,10 @@ static int agilent_82350b_pci_probe(struct pci_dev *dev, const struct pci_device
 }
 
 static const struct pci_device_id agilent_82350b_pci_table[] = {
-	{ PCI_VENDOR_ID_PLX,     PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_HP,
-	  PCI_SUBDEVICE_ID_82350A, 0, 0, 0 },
-	{ PCI_VENDOR_ID_AGILENT, PCI_DEVICE_ID_82350B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ PCI_VENDOR_ID_AGILENT, PCI_DEVICE_ID_82351A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0 }
+	{ PCI_VDEVICE_SUB(PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_HP, PCI_SUBDEVICE_ID_82350A) },
+	{ PCI_VDEVICE(AGILENT, PCI_DEVICE_ID_82350B) },
+	{ PCI_VDEVICE(AGILENT, PCI_DEVICE_ID_82351A) },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, agilent_82350b_pci_table);
 
diff --git a/drivers/gpib/cb7210/cb7210.c b/drivers/gpib/cb7210/cb7210.c
index 6dd8637c5964..c62c30fc3472 100644
--- a/drivers/gpib/cb7210/cb7210.c
+++ b/drivers/gpib/cb7210/cb7210.c
@@ -1093,10 +1093,10 @@ static int cb7210_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 }
 
 static const struct pci_device_id cb7210_pci_table[] = {
-	{PCI_VENDOR_ID_CBOARDS, PCI_DEVICE_ID_CBOARDS_PCI_GPIB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{PCI_VENDOR_ID_CBOARDS, PCI_DEVICE_ID_CBOARDS_CPCI_GPIB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{PCI_VENDOR_ID_QUANCOM, PCI_DEVICE_ID_QUANCOM_GPIB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
-	{ 0 }
+	{ PCI_VDEVICE(CBOARDS, PCI_DEVICE_ID_CBOARDS_PCI_GPIB) },
+	{ PCI_VDEVICE(CBOARDS, PCI_DEVICE_ID_CBOARDS_CPCI_GPIB) },
+	{ PCI_VDEVICE(QUANCOM, PCI_DEVICE_ID_QUANCOM_GPIB) },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, cb7210_pci_table);
 
diff --git a/drivers/gpib/cec/cec_gpib.c b/drivers/gpib/cec/cec_gpib.c
index c13bc302d9e9..530a777b1384 100644
--- a/drivers/gpib/cec/cec_gpib.c
+++ b/drivers/gpib/cec/cec_gpib.c
@@ -353,8 +353,8 @@ static int cec_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
 }
 
 static const struct pci_device_id cec_pci_table[] = {
-	{CEC_VENDOR_ID, CEC_DEV_ID, PCI_ANY_ID, CEC_SUBID, 0, 0, 0 },
-	{0}
+	{ PCI_DEVICE_SUB(CEC_VENDOR_ID, CEC_DEV_ID, PCI_ANY_ID, CEC_SUBID) },
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, cec_pci_table);
 
diff --git a/drivers/gpib/ines/ines_gpib.c b/drivers/gpib/ines/ines_gpib.c
index 3562f3184c28..6cd6ff596fda 100644
--- a/drivers/gpib/ines/ines_gpib.c
+++ b/drivers/gpib/ines/ines_gpib.c
@@ -371,14 +371,19 @@ enum ines_pci_subdevice_ids {
 };
 
 static struct pci_device_id ines_pci_table[] = {
-	{PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050, PCI_VENDOR_ID_PLX,
-	 PCI_SUBDEVICE_ID_INES_GPIB, 0, 0, 0},
-	{PCI_VENDOR_ID_AMCC, PCI_DEVICE_ID_INES_GPIB_AMCC, PCI_VENDOR_ID_AMCC,
-	 PCI_SUBDEVICE_ID_INES_GPIB, 0, 0, 0},
-	{PCI_VENDOR_ID_INES_QUICKLOGIC, PCI_DEVICE_ID_INES_GPIB_QL5030,
-	 PCI_VENDOR_ID_INES_QUICKLOGIC, PCI_DEVICE_ID_INES_GPIB_QL5030, 0, 0, 0},
-	{PCI_DEVICE(PCI_VENDOR_ID_QUANCOM, PCI_DEVICE_ID_QUANCOM_GPIB)},
-	{0}
+	{
+		PCI_VDEVICE_SUB(PLX, PCI_DEVICE_ID_PLX_9050,
+				PCI_VENDOR_ID_PLX, PCI_SUBDEVICE_ID_INES_GPIB),
+	}, {
+		PCI_VDEVICE_SUB(AMCC, PCI_DEVICE_ID_INES_GPIB_AMCC,
+				PCI_VENDOR_ID_AMCC, PCI_SUBDEVICE_ID_INES_GPIB),
+	}, {
+		PCI_VDEVICE_SUB(INES_QUICKLOGIC, PCI_DEVICE_ID_INES_GPIB_QL5030,
+				PCI_VENDOR_ID_INES_QUICKLOGIC, PCI_DEVICE_ID_INES_GPIB_QL5030),
+	}, {
+		PCI_VDEVICE(QUANCOM, PCI_DEVICE_ID_QUANCOM_GPIB),
+	},
+	{ }
 };
 MODULE_DEVICE_TABLE(pci, ines_pci_table);
 

base-commit: 7de6ae9e12207ec146f2f3f1e58d1a99317e88bc
-- 
2.47.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH RESEND] gpib: Initialize pci_device_ids using PCI_DEVICE macros
  2026-06-29 16:54 [PATCH RESEND] gpib: Initialize pci_device_ids using PCI_DEVICE macros Uwe Kleine-König (The Capable Hub)
@ 2026-07-17 10:22 ` 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-17 10:22 UTC (permalink / raw)
  To: Dave Penkler, Greg Kroah-Hartman; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1117 bytes --]

On Mon, Jun 29, 2026 at 06:54:26PM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> The PCI_DEVICE macro and its variants allow to initialize the first four
> members of a struct pci_device_id in a bit more compact form and also
> with an easier to grasp semantic. Explicit zeros are not needed, the
> compiler fills these in automatically.
> 
> So convert all array members to such a macro and drop unneeded zeros.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
> Hello,
> 
> this patch was sent already earlier[1], I was asked to include Greg in
> the to list, so here comes a resend.
> 
> Given that adding Greg to the list of recipients seems to be necessary,
> it would be great if Greg also appeared in
> 
> 	$ scripts/get_maintainer.pl -f drivers/gpib
> 	Dave Penkler <dpenkler@gmail.com> (maintainer:GPIB DRIVERS)
> 	linux-kernel@vger.kernel.org (open list)

It seems just adding Greg didn't help to get this patch applied. Is this
still on someone's radar? I guess Greg will only apply after seeing an
Ack by Dave?

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-17 10:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 16:54 [PATCH RESEND] gpib: Initialize pci_device_ids using PCI_DEVICE macros Uwe Kleine-König (The Capable Hub)
2026-07-17 10:22 ` 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

all inboxes | Powered by JetHome®