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

Configure Feed

Select the types of activity you want to include in your feed.

PCI: Remove useless WARN_ON() from devres

PCI's devres implementation contains a WARN_ON() which served to inform
users relying on the legacy devres iomap table that this table does not
support multiple mappings per BAR.

The WARN_ON() can be regarded as useless by now, since mapping a BAR
multiple times is legal behavior and old users of pcim_iomap_table(), the
accessor function for that table, did not break in the past PCI devres
cleanup. New PCI users will hopefully notice that pcim_iomap_table() is
deprecated and are unlikely to use it for mapping the same BAR multiple
times.

Moreover, WARN_ON()s create noisy, difficult to read error messages which
can be more confusing than helpful, since they don't inform the user about
what precisely the problem is.

Remove the WARN_ON().

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20251218092819.149665-2-phasta@kernel.org

authored by

Philipp Stanner and committed by
Bjorn Helgaas
94cf23f6 80d9411c

-3
-3
drivers/pci/devres.c
··· 469 469 if (!legacy_iomap_table) 470 470 return -ENOMEM; 471 471 472 - /* The legacy mechanism doesn't allow for duplicate mappings. */ 473 - WARN_ON(legacy_iomap_table[bar]); 474 - 475 472 legacy_iomap_table[bar] = mapping; 476 473 477 474 return 0;