]> git.itanic.dy.fi Git - linux-stable/commitdiff
powerpc/fsl-pci: Use PCI_HEADER_TYPE_MASK instead of literal
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 24 Nov 2023 09:09:14 +0000 (11:09 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 1 Dec 2023 21:00:54 +0000 (15:00 -0600)
Replace 0x7f literals with PCI_HEADER_TYPE_MASK.

Link: https://lore.kernel.org/r/20231124090919.23687-2-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/powerpc/sysdev/fsl_pci.c

index 3868483fbe292d5455a853cafd2da1df31eec7d4..ef7707ea0db7bc0b356470f0763d05d4e3c1d469 100644 (file)
@@ -54,7 +54,7 @@ static void quirk_fsl_pcie_early(struct pci_dev *dev)
 
        /* if we aren't in host mode don't bother */
        pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type);
-       if ((hdr_type & 0x7f) != PCI_HEADER_TYPE_BRIDGE)
+       if ((hdr_type & PCI_HEADER_TYPE_MASK) != PCI_HEADER_TYPE_BRIDGE)
                return;
 
        dev->class = PCI_CLASS_BRIDGE_PCI_NORMAL;
@@ -581,7 +581,7 @@ static int fsl_add_bridge(struct platform_device *pdev, int is_primary)
                hose->ops = &fsl_indirect_pcie_ops;
                /* For PCIE read HEADER_TYPE to identify controller mode */
                early_read_config_byte(hose, 0, 0, PCI_HEADER_TYPE, &hdr_type);
-               if ((hdr_type & 0x7f) != PCI_HEADER_TYPE_BRIDGE)
+               if ((hdr_type & PCI_HEADER_TYPE_MASK) != PCI_HEADER_TYPE_BRIDGE)
                        goto no_bridge;
 
        } else {