public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: "Michał Mirosław" <mirqus@gmail.com>
Cc: linux-serial@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Julia Lawall <julia@diku.dk>,
	cocci@diku.dk
Subject: Re: [PATCH 3/3] serial: make PCI device id constant
Date: Sun, 10 Jan 2010 20:43:51 +0100	[thread overview]
Message-ID: <4B4A2DF7.5020907@freemail.hu> (raw)
In-Reply-To: <e2d7436a1001100951w4dd7139as96e5808872f5c926@mail.gmail.com>

Michał Mirosław wrote:
> 2010/1/10 Németh Márton <nm127@freemail.hu>:
>> From: Márton Németh <nm127@freemail.hu>
>>
>> The id_table field of the struct pci_driver is constant in <linux/pci.h>
>> so it is worth to make initialization data also constant.
> [...]
>> diff -u -p a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
>> --- a/drivers/serial/8250_pci.c 2009-12-03 04:51:21.000000000 +0100
>> +++ b/drivers/serial/8250_pci.c 2010-01-08 18:40:05.000000000 +0100
>> @@ -2567,7 +2567,7 @@ static int pciserial_resume_one(struct p
>>  }
>>  #endif
>>
>> -static struct pci_device_id serial_pci_tbl[] = {
>> +static const struct pci_device_id serial_pci_tbl[] = {
>>        /* Advantech use PCI_DEVICE_ID_ADVANTECH_PCI3620 (0x3620) as 'PCI_SUBVENDOR_ID' */
>>        {       PCI_VENDOR_ID_ADVANTECH, PCI_DEVICE_ID_ADVANTECH_PCI3620,
>>                PCI_DEVICE_ID_ADVANTECH_PCI3620, 0x0001, 0, 0,
> [...]
> 
> There was similar patch sent to netdev couple days ago. For PCI
> devices it used DEFINE_PCI_DEVICE_TABLE() like this:
> 
> static DEFINE_PCI_DEVICE_TABLE(serial_pci_tbl) = {
> 
> so that the ID data went to the proper .ko section.

Thanks for the feedback. The DEFINE_PCI_DEVICE_TABLE() is also recommended
by Documentation/PCI/pci.txt .

Regads,

	Márton Németh

      reply	other threads:[~2010-01-10 19:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-10 16:59 [PATCH 3/3] serial: make PCI device id constant Németh Márton
2010-01-10 17:51 ` Michał Mirosław
2010-01-10 19:43   ` Németh Márton [this message]

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=4B4A2DF7.5020907@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=cocci@diku.dk \
    --cc=julia@diku.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=mirqus@gmail.com \
    /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