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

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to