Re: [PATCH] PCI: restore 2 missing pci ids

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 2, 2006, at 1:28 AM, Jeff Garzik wrote:

Kyle Moffett wrote:
On Feb 02, 2006, at 00:19, Lee Revell wrote:
On Wed, 2006-02-01 at 23:11 -0600, Mark Rustad wrote:

Why were the ids removed in the first place?

Because they weren't used by anything in the tree.
Also, the new PCI-ID policy is to put the defines in the driver itself, near where it is used, instead of collecting them in a single file. The goal is to minimize the number of unused PCI IDs in the tree by keeping the definition near the usage.

No, if you do create a constant for a PCI ID, it still should go into include/linux/pci_ids.h.

Putting them in the driver will result in highly variable naming policies, which in turn means the constants are less grep-able than today.

Device IDs simply do not need an associated constant, if they are used only in a PCI ID table. Device IDs are arbitrary numbers that are normally only used once in a source file.

Vendor IDs are used repeatedly, and definitely belong in pci_ids.h. Device IDs make sense in pci_ids.h if they are used more than once.

Thank you for explaining the policy. In this particular case, there was only one use of the ID in the file in question, so it could have simply been a hex constant, I guess. Of course my instinct is to avoid weird constants like this in source code, but I can learn to make an exception for this kind of thing.

--
Mark Rustad, [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux