Skip to content

Commit 19f73e9

Browse files
ij-intelbjorn-helgaas
authored andcommitted
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>
1 parent e3bdd2d commit 19f73e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/pci/setup-bus.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
134134
int i;
135135

136136
pci_dev_for_each_resource(dev, r, i) {
137+
const char *r_name = pci_resource_name(dev, i);
137138
struct pci_dev_resource *dev_res, *tmp;
138139
resource_size_t r_align;
139140
struct list_head *n;
@@ -146,8 +147,8 @@ static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
146147

147148
r_align = pci_resource_alignment(dev, r);
148149
if (!r_align) {
149-
pci_warn(dev, "BAR %d: %pR has bogus alignment\n",
150-
i, r);
150+
pci_warn(dev, "%s %pR: alignment must not be zero\n",
151+
r_name, r);
151152
continue;
152153
}
153154

0 commit comments

Comments
 (0)