linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pci: Use designated initialization in PCI_VDEVICE
@ 2014-03-31 21:58 Jeff Kirsher
  2014-03-31 22:08 ` Sergei Shtylyov
  0 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2014-03-31 21:58 UTC (permalink / raw)
  To: bhelgaas; +Cc: Mark Rustad, linux-pci, netdev, Jeff Kirsher

From: Mark Rustad <mark.d.rustad@intel.com>

By using designated initialization in PCI_VDEVICE, like other
similar macros, many "missing initializer" warnings that appear
when compiling with W=2 can be silenced.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 include/linux/pci.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index fb57c89..49455f9 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -680,8 +680,8 @@ struct pci_driver {
 
 /**
  * PCI_VDEVICE - macro used to describe a specific pci device in short form
- * @vendor: the vendor name
- * @device: the 16 bit PCI Device ID
+ * @vend: the vendor name
+ * @dev: the 16 bit PCI Device ID
  *
  * This macro is used to create a struct pci_device_id that matches a
  * specific PCI device.  The subvendor, and subdevice fields will be set
@@ -689,9 +689,9 @@ struct pci_driver {
  * private data.
  */
 
-#define PCI_VDEVICE(vendor, device)		\
-	PCI_VENDOR_ID_##vendor, (device),	\
-	PCI_ANY_ID, PCI_ANY_ID, 0, 0
+#define PCI_VDEVICE(vend, dev) \
+	.vendor = PCI_VENDOR_ID_##vend, .device = (dev), \
+	.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, 0, 0
 
 /* these external functions are only available when PCI support is enabled */
 #ifdef CONFIG_PCI
-- 
1.9.0


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

end of thread, other threads:[~2014-04-25  0:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-31 21:58 [PATCH] pci: Use designated initialization in PCI_VDEVICE Jeff Kirsher
2014-03-31 22:08 ` Sergei Shtylyov
2014-04-24 21:22   ` Bjorn Helgaas
2014-04-24 23:15     ` Rustad, Mark D
2014-04-24 23:43       ` Rustad, Mark D
2014-04-25  0:10       ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).