Skip to content

Commit 197e0da

Browse files
ij-intelbjorn-helgaas
authored andcommitted
x86/pci: Use PCI_HEADER_TYPE_* instead of literals
Replace 0x7f and 0x80 literals with PCI_HEADER_TYPE_* defines. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent e585a37 commit 197e0da

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

arch/x86/kernel/aperture_64.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,9 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp)
259259
order);
260260
}
261261

262-
/* No multi-function device? */
263262
type = read_pci_config_byte(bus, slot, func,
264263
PCI_HEADER_TYPE);
265-
if (!(type & 0x80))
264+
if (!(type & PCI_HEADER_TYPE_MFD))
266265
break;
267266
}
268267
}

arch/x86/kernel/early-quirks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,13 +779,13 @@ static int __init check_dev_quirk(int num, int slot, int func)
779779
type = read_pci_config_byte(num, slot, func,
780780
PCI_HEADER_TYPE);
781781

782-
if ((type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) {
782+
if ((type & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE) {
783783
sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS);
784784
if (sec > num)
785785
early_pci_scan_bus(sec);
786786
}
787787

788-
if (!(type & 0x80))
788+
if (!(type & PCI_HEADER_TYPE_MFD))
789789
return -1;
790790

791791
return 0;

0 commit comments

Comments
 (0)