Skip to contentSkip to conversation

Convert pci_table entries with PCI_ANY_ID to PCI_DEVICE ?

PATCH Peter Hüwe 1 participant 2 messages Jul 15, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I was wondering what you think about changing pci_table entries with subvendor=PCI_ANY_ID and subdevice=PCI_ANY_ID to use the PCI_DEVICE MACRO?

Here's a sample patch:

---

(quoted diff) +0 -0

b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
index 16e3483..b0126eb 100644

arch/x86/kernel/cpu/cpufreq/gx-suspmod.c +3 -7
@@ -169,12 +169,9 @@ static int gx_freq_mult[16] = {
  *     Low Level chipset interface                             *
  ****************************************************************/
 static struct pci_device_id gx_chipset_tbl[] __initdata = {
-       { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
-               PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520,
-               PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510,
-               PCI_ANY_ID, PCI_ANY_ID },
+       { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY) },
+       { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520) },
+       { PCI_DEVICE(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510) },
        { 0, },
 };
---

Do you think it's worth the effort (e.g. in terms of readability) to convert the entries?

Thanks,
Peter

#1 lore raw

Or even better convert them using PCI_VDEVICE,

Here's the same sample patch with PCI_VDEVICE:

---

(quoted diff) +0 -0

b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c
index 16e3483..581b29c 100644

arch/x86/kernel/cpu/cpufreq/gx-suspmod.c +3 -7
@@ -169,12 +169,9 @@ static int gx_freq_mult[16] = {
  *     Low Level chipset interface                             *
  ****************************************************************/
 static struct pci_device_id gx_chipset_tbl[] __initdata = {
-       { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY,
-               PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5520,
-               PCI_ANY_ID, PCI_ANY_ID },
-       { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5510,
-               PCI_ANY_ID, PCI_ANY_ID },
+       { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY) },
+       { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5520) },
+       { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5510) },
        { 0, },
 };
---

What do you think?