ARM: PCI: Use PCI_CLASS_* defines for PCI class
PATCH 1/1 ARM: PCI: Use PCI_CLASS_* defines for PCI class
--- arch/arm/kernel/bios32.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm/kernel/bios32.c +2 -3
@@ -255,10 +255,9 @@ static void pci_fixup_it8152(struct pci_dev *dev) {int i;/* fixup for ITE 8152 devices */ -/* FIXME: add defines for class 0x68000 and 0x80103 */ if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_HOST || - dev->class ==0x68000 || - dev->class ==0x80103 ) { + dev->class == (PCI_CLASS_BRIDGE_OTHER <<8 ) || + dev->class == ((PCI_CLASS_SYSTEM_DMA <<8 ) |0x03 )) {for (i =0 ; i <PCI_NUM_RESOURCES ; i++) { dev->resource[i].start =0 ; dev->resource[i].end =0 ;
Signature · 1 line
1.7.10.4
Quoted 13 lines · Rostislav Lisovy
Signed-off-by Rostislav Lisovy <[email protected]>--- arch/arm/kernel/bios32.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)arch/arm/kernel/bios32.c +0
-0@@ -255,10 +255,9 @@ static void pci_fixup_it8152(struct pci_dev *dev) {int i;
arch/arm/kernel/bios32.c static void pci_fixup_it8152(struct pci_dev *dev) · line 263
Quoted 10 lines
arch/arm/kernel/bios32.c +2
-3/* fixup for ITE 8152 devices */ -/* FIXME: add defines for class 0x68000 and 0x80103 */ if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_HOST || - dev->class ==0x68000 || - dev->class ==0x80103 ) { + dev->class == (PCI_CLASS_BRIDGE_OTHER <<8 ) || + dev->class == ((PCI_CLASS_SYSTEM_DMA <<8 ) |0x03 )) {for (i =0 ; i <PCI_NUM_RESOURCES ; i++) { dev->resource[i].start =0 ; dev->resource[i].end =0 ;
Care to explain how your new code is equivalent to the old one?
Thanks,
Sasha
Quoted 11 lines · Sasha Levin
arch/arm/kernel/bios32.c static void pci_fixup_it8152(struct pci_dev *dev) · line 263
Quoted 10 lines
arch/arm/kernel/bios32.c +2
-3-/* FIXME: add defines for class 0x68000 and 0x80103 */ if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_HOST || - dev->class ==0x68000 || - dev->class ==0x80103 ) { + dev->class == (PCI_CLASS_BRIDGE_OTHER <<8 ) || + dev->class == ((PCI_CLASS_SYSTEM_DMA <<8 ) |0x03 )) {for (i =0 ; i <PCI_NUM_RESOURCES ; i++) { dev->resource[i].start =0 ; dev->resource[i].end =0 ;
Quoted 1 line
Care to explain how your new code is equivalent to the old one?
The header file include/linux/pci_ids.h defines
#define PCI_CLASS_BRIDGE_OTHER 0x0680
#define PCI_CLASS_SYSTEM_DMA 0x0801
((struct pci_dev*)dev)->class
corresponds to the 3 bytes Class code in the PCI Configuration space header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.
In that case
(PCI_CLASS_BRIDGE_OTHER << 8)
is equivalent to 0x68000 (imagine the leading zero) and
((PCI_CLASS_SYSTEM_DMA << 8) | 0x03))
is equivalent to 0x80103.
Best regards;
Rostislav
Quoted 22 lines · Rostislav Lisovy
Quoted 11 lines · Sasha Levin
arch/arm/kernel/bios32.c static void pci_fixup_it8152(struct pci_dev *dev) · line 263
Quoted 10 lines
arch/arm/kernel/bios32.c +2
-3-/* FIXME: add defines for class 0x68000 and 0x80103 */ if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_HOST || - dev->class ==0x68000 || - dev->class ==0x80103 ) { + dev->class == (PCI_CLASS_BRIDGE_OTHER <<8 ) || + dev->class == ((PCI_CLASS_SYSTEM_DMA <<8 ) |0x03 )) {for (i =0 ; i <PCI_NUM_RESOURCES ; i++) { dev->resource[i].start =0 ; dev->resource[i].end =0 ;Quoted 1 line
Care to explain how your new code is equivalent to the old one?
The header file
include/linux/pci_ids.hdefines
#definePCI_CLASS_BRIDGE_OTHER0x0680
#definePCI_CLASS_SYSTEM_DMA0x0801((struct pci_dev*)dev)->class
corresponds to the 3 bytes Class code in the PCI Configuration space header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.
Quoted 7 lines
In that case
(PCI_CLASS_BRIDGE_OTHER<< 8)
is equivalent to0x68000(imagine the leading zero) and
((PCI_CLASS_SYSTEM_DMA<< 8) |0x03))
is equivalent to0x80103.
Just a kind reminder in case anyone is interested in reviewing and accepting the patch.
Best regards;
Rostislav Lisovy
Yijing Wang
Reviewed-byQuoted 31 lines · Rostislav Lisovy
Quoted 22 lines · Rostislav Lisovy
Quoted 11 lines · Sasha Levin
arch/arm/kernel/bios32.c static void pci_fixup_it8152(struct pci_dev *dev) · line 263
Quoted 10 lines
arch/arm/kernel/bios32.c +2
-3-/* FIXME: add defines for class 0x68000 and 0x80103 */ if ((dev->class >>8 ) ==PCI_CLASS_BRIDGE_HOST || - dev->class ==0x68000 || - dev->class ==0x80103 ) { + dev->class == (PCI_CLASS_BRIDGE_OTHER <<8 ) || + dev->class == ((PCI_CLASS_SYSTEM_DMA <<8 ) |0x03 )) {for (i =0 ; i <PCI_NUM_RESOURCES ; i++) { dev->resource[i].start =0 ; dev->resource[i].end =0 ;Quoted 1 line
Care to explain how your new code is equivalent to the old one?
The header file
include/linux/pci_ids.hdefines
#definePCI_CLASS_BRIDGE_OTHER0x0680
#definePCI_CLASS_SYSTEM_DMA0x0801((struct pci_dev*)dev)->class
corresponds to the 3 bytes Class code in the PCI Configuration space header -- 1B Base class, 1B Sub-class, 1B Reg-level interface.Quoted 7 lines
In that case
(PCI_CLASS_BRIDGE_OTHER<< 8)
is equivalent to0x68000(imagine the leading zero) and
((PCI_CLASS_SYSTEM_DMA<< 8) |0x03))
is equivalent to0x80103.
Quoted 2 lines
Just a kind reminder in case anyone is interested in reviewing and accepting the patch.
Quoted 8 lines
Best regards;
Rostislav Lisovy.
Signature · 2 lines
Thanks! Yijing