Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: Improve pdev_sort_resources() warning message

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>

authored by

Ilpo Järvinen and committed by
Bjorn Helgaas
19f73e93 e3bdd2dd

+3 -2
+3 -2
drivers/pci/setup-bus.c
··· 134 134 int i; 135 135 136 136 pci_dev_for_each_resource(dev, r, i) { 137 + const char *r_name = pci_resource_name(dev, i); 137 138 struct pci_dev_resource *dev_res, *tmp; 138 139 resource_size_t r_align; 139 140 struct list_head *n; ··· 147 146 148 147 r_align = pci_resource_alignment(dev, r); 149 148 if (!r_align) { 150 - pci_warn(dev, "BAR %d: %pR has bogus alignment\n", 151 - i, r); 149 + pci_warn(dev, "%s %pR: alignment must not be zero\n", 150 + r_name, r); 152 151 continue; 153 152 } 154 153