PCI/AER: Move aer_print_source() earlier in file
authorBjorn Helgaas <bhelgaas@google.com>
Thu, 22 May 2025 23:21:13 +0000 (18:21 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 23 May 2025 16:00:54 +0000 (11:00 -0500)
Move aer_print_source() earlier in the file so a future change can use it
from aer_print_error(), where it's easier to rate limit it.

Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://patch.msgid.link/20250522232339.1525671-8-helgaas@kernel.org
drivers/pci/pcie/aer.c

index 8b23ef90345b56efa5d400d0ca5cfb9258d4bf49..c0481550363b070ab2f93a6505b2c78edd9901cc 100644 (file)
@@ -696,6 +696,19 @@ static void __aer_print_error(struct pci_dev *dev,
        pci_dev_aer_stats_incr(dev, info);
 }
 
+static void aer_print_source(struct pci_dev *dev, struct aer_err_info *info,
+                            bool found)
+{
+       u16 source = info->id;
+
+       pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d%s\n",
+                info->multi_error_valid ? "Multiple " : "",
+                aer_error_severity_string[info->severity],
+                pci_domain_nr(dev->bus), PCI_BUS_NUM(source),
+                PCI_SLOT(source), PCI_FUNC(source),
+                found ? "" : " (no details found");
+}
+
 void aer_print_error(struct pci_dev *dev, struct aer_err_info *info)
 {
        int layer, agent;
@@ -733,19 +746,6 @@ out:
                        info->severity, info->tlp_header_valid, &info->tlp);
 }
 
-static void aer_print_source(struct pci_dev *dev, struct aer_err_info *info,
-                            bool found)
-{
-       u16 source = info->id;
-
-       pci_info(dev, "%s%s error message received from %04x:%02x:%02x.%d%s\n",
-                info->multi_error_valid ? "Multiple " : "",
-                aer_error_severity_string[info->severity],
-                pci_domain_nr(dev->bus), PCI_BUS_NUM(source),
-                PCI_SLOT(source), PCI_FUNC(source),
-                found ? "" : " (no details found");
-}
-
 #ifdef CONFIG_ACPI_APEI_PCIEAER
 int cper_severity_to_aer(int cper_severity)
 {