]> git.itanic.dy.fi Git - linux-stable/commitdiff
EDAC/pci_sysfs: Use PCI_HEADER_TYPE_MASK instead of literals
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fri, 24 Nov 2023 09:09:17 +0000 (11:09 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Fri, 24 Nov 2023 14:08:37 +0000 (15:08 +0100)
Replace literal 0x7f with PCI_HEADER_TYPE_MASK.

No functional changes:

  $ sha1sum drivers/edac/edac_pci_sysfs.o.*
  805b33a090d8019d8b3b348191f630c72c748c9c drivers/edac/edac_pci_sysfs.o.before
  805b33a090d8019d8b3b348191f630c72c748c9c drivers/edac/edac_pci_sysfs.o.after

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231124090919.23687-5-ilpo.jarvinen@linux.intel.com
drivers/edac/edac_pci_sysfs.c

index 287cc51dbc868a6437767288f8a67159f4bf354b..901d4cd3ca38769c4f1561e9c3a6153e1f70ea4a 100644 (file)
@@ -521,7 +521,7 @@ static void edac_pci_dev_parity_clear(struct pci_dev *dev)
        /* read the device TYPE, looking for bridges */
        pci_read_config_byte(dev, PCI_HEADER_TYPE, &header_type);
 
-       if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE)
+       if ((header_type & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE)
                get_pci_parity_status(dev, 1);
 }
 
@@ -583,7 +583,7 @@ static void edac_pci_dev_parity_test(struct pci_dev *dev)
        edac_dbg(4, "PCI HEADER TYPE= 0x%02x %s\n",
                 header_type, dev_name(&dev->dev));
 
-       if ((header_type & 0x7F) == PCI_HEADER_TYPE_BRIDGE) {
+       if ((header_type & PCI_HEADER_TYPE_MASK) == PCI_HEADER_TYPE_BRIDGE) {
                /* On bridges, need to examine secondary status register  */
                status = get_pci_parity_status(dev, 1);