From: Sam Ravnborg <sam@ravnborg.org>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Greg KH <greg@kroah.com>, Jeff Garzik <jeff@garzik.org>,
Kees Cook <kees@ubuntu.com>,
linux-kernel@vger.kernel.org, Ben Collins <bcollins@ubuntu.com>,
Michael Wu <flamingice@sourmilk.net>
Subject: Re: [PATCH] pci: fix unterminated pci_device_id lists
Date: Thu, 13 Sep 2007 08:58:19 +0200 [thread overview]
Message-ID: <20070913065819.GA23235@uranus.ravnborg.org> (raw)
In-Reply-To: <b6fcc0a0709122334qa31fffby4afbf857c92efb89@mail.gmail.com>
On Thu, Sep 13, 2007 at 10:34:02AM +0400, Alexey Dobriyan wrote:
> [non-terminated PCI ids arrays]
>
> Here is compile-time hack (yep, warped and whitespace damaged :))
> It's better than modpost-time hack. because it triggers earlier.
> It's worse than modpost-time hack, because of tree-wide changes.
>
> diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
> index f4e4298..b895b5f 100644
> --- a/drivers/net/8139too.c
> +++ b/drivers/net/8139too.c
> @@ -237,7 +237,7 @@ static const struct {
> };
>
>
> -static struct pci_device_id rtl8139_pci_tbl[] = {
> +PCI_MODULE_DEVICE_TABLE_BEGIN(rtl8139_pci_tbl)
> {0x10ec, 0x8139, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> {0x10ec, 0x8138, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> {0x1113, 0x1211, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8139 },
> @@ -273,10 +273,7 @@ static struct pci_device_id rtl8139_pci_tbl[] = {
> {PCI_ANY_ID, 0x8139, 0x10ec, 0x8139, 0, 0, RTL8139 },
> {PCI_ANY_ID, 0x8139, 0x1186, 0x1300, 0, 0, RTL8139 },
> {PCI_ANY_ID, 0x8139, 0x13d1, 0xab06, 0, 0, RTL8139 },
> -
> - {0,}
> -};
> -MODULE_DEVICE_TABLE (pci, rtl8139_pci_tbl);
> +PCI_MODULE_DEVICE_TABLE_END
Looks at bit too magic to my taste.
And anyway deferring the check until modpost time should not cause troubles
anyway assuming people do build their kernel after adding a device ID.
And the above requires one to use the special macro in all places
whereas the modpost check will catch it also for new device ID users.
Sam
next prev parent reply other threads:[~2007-09-13 6:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-12 6:41 Kees Cook
2007-09-12 11:10 ` Jeff Garzik
2007-09-12 11:48 ` Alexey Dobriyan
2007-09-12 21:53 ` Greg KH
2007-09-12 23:08 ` Andrew Morton
2007-09-13 6:34 ` Alexey Dobriyan
2007-09-13 6:42 ` Jeff Garzik
2007-09-15 9:01 ` Jan Engelhardt
2007-09-13 6:58 ` Sam Ravnborg [this message]
2007-09-13 0:49 ` [PATCH] modpost: detect unterminated device id lists Kees Cook
2007-09-13 1:21 ` Andrew Morton
2007-09-16 22:14 ` Andrew Morton
2007-09-17 0:24 ` Satyam Sharma
2007-09-17 6:46 ` Andrew Morton
2007-09-17 21:45 ` Satyam Sharma
2007-09-17 21:50 ` Andrew Morton
2007-09-17 23:36 ` Mauro Carvalho Chehab
2007-09-17 1:22 ` Satyam Sharma
2007-09-17 3:45 ` Kees Cook
2007-09-17 6:48 ` Andrew Morton
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=20070913065819.GA23235@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=adobriyan@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=bcollins@ubuntu.com \
--cc=flamingice@sourmilk.net \
--cc=greg@kroah.com \
--cc=jeff@garzik.org \
--cc=kees@ubuntu.com \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome