]> git.itanic.dy.fi Git - linux-stable/commitdiff
x86/pci: Use PCI_HEADER_TYPE_* instead of literals
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 24 Nov 2023 09:09:13 +0000 (11:09 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 1 Dec 2023 21:00:43 +0000 (15:00 -0600)
Replace 0x7f and 0x80 literals with PCI_HEADER_TYPE_* defines.

Link: https://lore.kernel.org/r/20231124090919.23687-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
arch/x86/kernel/aperture_64.c
arch/x86/kernel/early-quirks.c

index 4feaa670d5783b8fe9bb226d0635c09bb15939da..89c0c8a3fc7e6c0c84ce98541d6cd1430ab91b41 100644 (file)
@@ -259,10 +259,9 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp)
                                                        order);
                                }
 
-                               /* No multi-function device? */
                                type = read_pci_config_byte(bus, slot, func,
                                                               PCI_HEADER_TYPE);
-                               if (!(type & 0x80))
+                               if (!(type & PCI_HEADER_TYPE_MFD))
                                        break;
                        }
                }
index a6c1867fc7aa3ea0eb9b24fc1992c90119d2febb..59f4aefc6bc1625fe0a8e3cb43f8f62ad5a89eab 100644 (file)
@@ -779,13 +779,13 @@ static int __init check_dev_quirk(int num, int slot, int func)
        type = read_pci_config_byte(num, slot, func,
                                    PCI_HEADER_TYPE);
 
-       if ((type & 0x7f) == PCI_HEADER_TYPE_BRIDGE) {
+       if ((type & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE) {
                sec = read_pci_config_byte(num, slot, func, PCI_SECONDARY_BUS);
                if (sec > num)
                        early_pci_scan_bus(sec);
        }
 
-       if (!(type & 0x80))
+       if (!(type & PCI_HEADER_TYPE_MFD))
                return -1;
 
        return 0;