Skip to content

Commit fab874e

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI/AER: Descope pci_printk() to aer_printk()
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/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]> [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 <[email protected]>
1 parent 2014c95 commit fab874e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

drivers/pci/pcie/aer.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#include <linux/bitops.h>
1919
#include <linux/cper.h>
20+
#include <linux/dev_printk.h>
2021
#include <linux/pci.h>
2122
#include <linux/pci-acpi.h>
2223
#include <linux/sched.h>
@@ -35,6 +36,9 @@
3536
#include "../pci.h"
3637
#include "portdrv.h"
3738

39+
#define aer_printk(level, pdev, fmt, arg...) \
40+
dev_printk(level, &(pdev)->dev, fmt, ##arg)
41+
3842
#define AER_ERROR_SOURCES_MAX 128
3943

4044
#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,
686690
if (!errmsg)
687691
errmsg = "Unknown Error Bit";
688692

689-
pci_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg,
693+
aer_printk(level, dev, " [%2d] %-22s%s\n", i, errmsg,
690694
info->first_error == i ? " (First)" : "");
691695
}
692696
pci_dev_aer_stats_incr(dev, info);
@@ -709,11 +713,11 @@ void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
709713

710714
level = (info->severity == AER_CORRECTABLE) ? KERN_WARNING : KERN_ERR;
711715

712-
pci_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
716+
aer_printk(level, dev, "PCIe Bus Error: severity=%s, type=%s, (%s)\n",
713717
aer_error_severity_string[info->severity],
714718
aer_error_layer[layer], aer_agent_string[agent]);
715719

716-
pci_printk(level, dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",
720+
aer_printk(level, dev, " device [%04x:%04x] error status/mask=%08x/%08x\n",
717721
dev->vendor, dev->device, info->status, info->mask);
718722

719723
__aer_print_error(dev, info);

0 commit comments

Comments
 (0)