From: Jeff Garzik <jgarzik@pobox.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Henning Schmiedehausen <hps@intermeta.de>,
Linux IDE Mailingliste <linux-ide@vger.kernel.org>
Subject: Re: PCI Constants Update for SATA Driver
Date: Wed, 02 Mar 2005 00:49:49 -0500 [thread overview]
Message-ID: <422553FD.2050000@pobox.com> (raw)
In-Reply-To: <1109728077.5610.78.camel@gaston>
Benjamin Herrenschmidt wrote:
> On Sun, 2005-02-27 at 13:08 -0500, Jeff Garzik wrote:
>
>>Henning Schmiedehausen wrote:
>>
>>>Hi,
>>>
>>>having the various constants in pci_ids.h is a really good thing for
>>>grepping through the kernel source. And if they were used, it would be
>>>even better (if you e.g. are looking for which driver claims an SIImage
>>>3112 card...). However, the sata_xxx.c files in the drivers/scsi
>>>directory are notorious for not using the PCI Ids but just hard coded
>>>numbers.
>>>
>>>This patch tries to fix this. It is against the 2.6.10 tree from Fedora
>>>Core 3 but should apply to a regular 2.6.10 too.
>>
>>"Notorious", heh. This is quite intentional.
>>
>>PCI device ids are just random numbers that vendors pick out of thin
>>air. Device id symbolic constants have little value, and creates churn
>>whereby every kernel hacker is patching include/linux/pci_ids.h.
>
>
> I still agree that it's handy to use the constants in pci_ids.h when
> available, I do that for grepping regulary.
>
> What I usually do is that I separately send patches updating pci_ids.h
> and driver patches. In some cases, I leave the numeric constant in the
> driver until I'm sure the pci_ids.h patch got in, then eventually fix up
> the driver to use the constant.
Well, for SATA and net drivers, I strongly prefer
{ PCI_VENDOR_ID_xxx, 0x1234, PCI_ANY_ID, PCI_ANY_ID, ... }
or
{ PCI_DEVICE(PCI_VENDOR_ID_xxx, 0x1234), ... }
IFF [1] the PCI device id is used in more than one place in the entire
kernel, then using PCI_DEVICE_ID_xxx is OK.
Regards,
Jeff
[1] - that's "if and only if", for the non-math types
next prev parent reply other threads:[~2005-03-02 5:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-27 17:42 PCI Constants Update for SATA Driver Henning Schmiedehausen
2005-02-27 18:08 ` Jeff Garzik
2005-02-27 19:20 ` Henning Schmiedehausen
2005-02-27 19:52 ` Jeff Garzik
2005-02-27 20:05 ` Henning Schmiedehausen
2005-02-27 20:07 ` Jeff Garzik
2005-03-02 1:47 ` Benjamin Herrenschmidt
2005-03-02 5:49 ` Jeff Garzik [this message]
2005-03-02 1:46 ` Benjamin Herrenschmidt
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=422553FD.2050000@pobox.com \
--to=jgarzik@pobox.com \
--cc=benh@kernel.crashing.org \
--cc=hps@intermeta.de \
--cc=linux-ide@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;
as well as URLs for NNTP newsgroup(s).