]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
PCI: Improve pdev_sort_resources() warning message
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Thu, 17 Oct 2024 09:55:45 +0000 (12:55 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 18 Oct 2024 23:41:11 +0000 (18:41 -0500)
Use pci_resource_name() helper in pdev_sort_resources() to print resources
in user-friendly format. Also replace the vague "bogus alignment" with a
more precise explanation of the problem.

Link: https://lore.kernel.org/r/20241017095545.1424-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Philipp Stanner <pstanner@redhat.com>
drivers/pci/setup-bus.c

index 27da27c59e899164032bda4e8d6a3e82fabb1e76..5e00cecf1f1af30d11d80338abbf44c223b030ca 100644 (file)
@@ -134,6 +134,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
        int i;
 
        pci_dev_for_each_resource(dev, r, i) {
+               const char *r_name = pci_resource_name(dev, i);
                struct pci_dev_resource *dev_res, *tmp;
                resource_size_t r_align;
                struct list_head *n;
@@ -146,8 +147,8 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
 
                r_align = pci_resource_alignment(dev, r);
                if (!r_align) {
-                       pci_warn(dev, "BAR %d: %pR has bogus alignment\n",
-                                i, r);
+                       pci_warn(dev, "%s %pR: alignment must not be zero\n",
+                                r_name, r);
                        continue;
                }