]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI/AER: Descope pci_printk() to aer_printk()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 16 Dec 2024 16:10:12 +0000 (18:10 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 21 Feb 2025 23:17:08 +0000 (17:17 -0600)
include/linux/pci.h provides low-level pci_printk() interface that is
only used by AER because it needs to print the same message with
different levels depending on the error severity. No other PCI code
uses that functionality and calls pci_<level>() logging functions
directly with the appropriate level.

Descope pci_printk() into AER as aer_printk().

Link: https://lore.kernel.org/r/20241216161012.1774-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[bhelgaas: retain pci_printk() for now since shpchp still uses it and I
moved those patches to a different branch]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/pcie/aer.c

index 508474e171835eea48757c19b4c8ca4f6867ad6e..ad4206125b86b843635282f3742d423ab3446265 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <linux/bitops.h>
 #include <linux/cper.h>
+#include <linux/dev_printk.h>
 #include <linux/pci.h>
 #include <linux/pci-acpi.h>
 #include <linux/sched.h>
@@ -35,6 +36,9 @@
 #include "../pci.h"
 #include "portdrv.h"
 
+#define aer_printk(level, pdev, fmt, arg...) \
+       dev_printk(level, &(pdev)->dev, fmt, ##arg)
+
 #define AER_ERROR_SOURCES_MAX          128
 
 #define AER_MAX_TYPEOF_COR_ERRS                16      /* as per PCI_ERR_COR_STATUS */
@@ -686,7 +690,7 @@ static void __aer_print_error(struct pci_dev *dev,
                if (!errmsg)
                        errmsg = "Unknown Error Bit";
 
-               pci_printk(level, dev, "   [%2d] %-22s%s\n", i, errmsg,
+               aer_printk(level, dev, "   [%2d] %-22s%s\n", i, errmsg,
                                info->first_error == i ? " (First)" : "");
        }
        pci_dev_aer_stats_incr(dev, info);
@@ -709,11 +713,11 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
 
        level = (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR;
 
-       pci_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
+       aer_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
                   aer_error_severity_string[info->severity],
                   aer_error_layer[layer], aer_agent_string[agent]);
 
-       pci_printk(level, dev, "  device [%04x:%04x] error status/mask=%08x/%08x\n",
+       aer_printk(level, dev, "  device [%04x:%04x] error status/mask=%08x/%08x\n",
                   dev->vendor, dev->device, info->status, info->mask);
 
        __aer_print_error(dev, info);