From: Greg KH <greg@kroah.com>
To: "David S. Miller" <davem@redhat.com>
Cc: Jeff Garzik <jgarzik@pobox.com>,
rddunlap@osdl.org, davej@redhat.com, willy@debian.org,
linux-kernel@vger.kernel.org,
kernel-janitor-discuss@lists.sourceforge.net
Subject: Re: C99 Initialisers
Date: Wed, 13 Aug 2003 10:31:51 -0700 [thread overview]
Message-ID: <20030813173150.GA3317@kroah.com> (raw)
In-Reply-To: <20030813031432.22b6a0d6.davem@redhat.com>
On Wed, Aug 13, 2003 at 03:14:32AM -0700, David S. Miller wrote:
>
> Hey guys, define a set of macros to make it more readable.
> This would keep the number of lines down and also make
> the C99 folks happy.
Heh, much like the USB people have had for years :)
How about this patch? If you like it I'll add the pci.h change to the
tree and let you take the tg3.c part.
thanks,
greg k-h
# add PCI_DEVICE() macro to make pci_device_id tables easier to read.
diff -Nru a/drivers/net/tg3.c b/drivers/net/tg3.c
--- a/drivers/net/tg3.c Wed Aug 13 10:29:08 2003
+++ b/drivers/net/tg3.c Wed Aug 13 10:29:08 2003
@@ -128,36 +128,21 @@
static int tg3_debug = -1; /* -1 == use TG3_DEF_MSG_ENABLE as value */
static struct pci_device_id tg3_pci_tbl[] = {
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5701,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702FE,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702X,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703X,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704S,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702A3,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703A3,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_SYSKONNECT, 0x4400,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1001,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
- { PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC9100,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5700) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5701) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702FE) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702X) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703X) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5704S) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5702A3) },
+ { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5703A3) },
+ { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x4400) },
+ { PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000) },
+ { PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1001) },
+ { PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC9100) },
{ 0, }
};
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Wed Aug 13 10:29:08 2003
+++ b/include/linux/pci.h Wed Aug 13 10:29:08 2003
@@ -524,6 +524,18 @@
#define to_pci_driver(drv) container_of(drv,struct pci_driver, driver)
+/**
+ * PCI_DEVICE - macro used to describe a specific pci device
+ * @vend: the 16 bit PCI Vendor ID
+ * @dev: the 16 bit PCI Device ID
+ *
+ * This macro is used to create a struct pci_device_id that matches a
+ * specific device. The subvendor and subdevice fields will be set to
+ * PCI_ANY_ID.
+ */
+#define PCI_DEVICE(vend,dev) \
+ .vendor = (vend), .device = (dev), \
+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
/* these external functions are only available when PCI support is enabled */
#ifdef CONFIG_PCI
next prev parent reply other threads:[~2003-08-13 17:32 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-12 2:02 C99 Initialisers CaT
2003-08-12 2:18 ` Robert Love
2003-08-12 2:39 ` Matthew Wilcox
2003-08-12 2:45 ` Robert Love
2003-08-12 2:57 ` Dagfinn Ilmari Mannsåker
2003-08-12 5:38 ` Greg KH
2003-08-12 9:01 ` Maciej Soltysiak
2003-08-12 10:03 ` Geert Uytterhoeven
2003-08-12 10:19 ` Jakub Jelinek
2003-08-12 11:27 ` Matthew Wilcox
2003-08-12 16:54 ` Ian Hastie
2003-08-12 18:01 ` Greg KH
2003-08-12 23:53 ` Dave Jones
2003-08-13 0:08 ` Matthew Wilcox
2003-08-13 0:23 ` Greg KH
2003-08-13 0:31 ` Matthew Wilcox
2003-08-14 5:45 ` H. Peter Anvin
2003-08-13 15:52 ` Timothy Miller
2003-08-13 17:50 ` Jeff Garzik
2003-08-13 0:02 ` Jeff Garzik
2003-08-13 0:14 ` Randy.Dunlap
2003-08-13 0:31 ` Jeff Garzik
2003-08-13 0:37 ` Randy.Dunlap
2003-08-13 0:49 ` Dave Jones
2003-08-13 1:25 ` Jeff Garzik
2003-08-13 3:02 ` Randy.Dunlap
2003-08-13 3:26 ` Jeff Garzik
2003-08-13 10:14 ` David S. Miller
2003-08-13 17:31 ` Greg KH [this message]
2003-08-13 17:36 ` David S. Miller
2003-08-13 17:47 ` Jeff Garzik
2003-08-13 18:02 ` Greg KH
2003-08-13 18:26 ` Jeff Garzik
2003-08-13 18:38 ` Russell King
2003-08-13 19:44 ` Jeff Garzik
2003-08-13 19:54 ` Matthew Wilcox
2003-08-13 20:15 ` Greg KH
2003-08-13 20:16 ` Dave Jones
2003-08-13 20:30 ` Matt Domsch
2003-08-13 20:29 ` Jeff Garzik
2003-08-13 21:05 ` Sam Ravnborg
2003-08-13 22:24 ` Roman Zippel
2003-08-14 20:31 ` Sam Ravnborg
2003-08-14 10:05 ` Geert Uytterhoeven
2003-08-14 10:25 ` Gene Heskett
2003-08-14 10:52 ` jw schultz
2003-08-14 12:34 ` Geert Uytterhoeven
2003-08-14 12:57 ` Andrey Panin
2003-08-14 18:45 ` H. Peter Anvin
2003-08-13 21:06 ` Russell King
2003-08-13 21:17 ` Eduardo Pereira Habkost
2003-08-13 17:50 ` Sam Ravnborg
2003-08-13 17:54 ` Jeff Garzik
2003-08-13 17:54 ` Matthew Wilcox
2003-08-13 17:58 ` Jeff Garzik
2003-08-13 18:03 ` Greg KH
2003-08-13 17:58 ` Greg KH
2003-08-13 18:21 ` Sam Ravnborg
2003-08-13 18:09 ` Russell King
2003-08-13 20:21 ` Krzysztof Halasa
2003-08-13 21:17 ` David S. Miller
2003-08-13 21:26 ` Greg KH
2003-08-14 22:46 ` Krzysztof Halasa
2003-08-12 17:37 ` Dave Jones
2003-08-12 17:48 ` Matthew Wilcox
2003-08-12 22:06 ` Ian Hastie
2003-08-13 15:54 ` CaT
2003-08-14 6:57 ` Maciej Soltysiak
-- strict thread matches above, loose matches on Subject: below --
2003-08-12 16:52 Shureih, Tariq
[not found] <jFFu.7t8.15@gated-at.bofh.it>
[not found] ` <jLKX.4KI.13@gated-at.bofh.it>
[not found] ` <jRnj.2dx.11@gated-at.bofh.it>
[not found] ` <jRwZ.2kJ.15@gated-at.bofh.it>
[not found] ` <jRQi.2zQ.5@gated-at.bofh.it>
[not found] ` <jRZY.2Hw.5@gated-at.bofh.it>
[not found] ` <jS9J.2Np.5@gated-at.bofh.it>
[not found] ` <jUbt.57S.7@gated-at.bofh.it>
[not found] ` <jUuT.5kZ.13@gated-at.bofh.it>
[not found] ` <k13k.22O.3@gated-at.bofh.it>
[not found] ` <k7Lq.7Gr.7@gated-at.bofh.it>
2003-08-13 21:19 ` junkio
2003-08-13 22:18 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030813173150.GA3317@kroah.com \
--to=greg@kroah.com \
--cc=davej@redhat.com \
--cc=davem@redhat.com \
--cc=jgarzik@pobox.com \
--cc=kernel-janitor-discuss@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rddunlap@osdl.org \
--cc=willy@debian.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.