[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20251218092819.149665-2-phasta@kernel.org>
Date: Thu, 18 Dec 2025 10:28:20 +0100
From: Philipp Stanner <phasta@...nel.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Philipp Stanner <phasta@...nel.org>,
Guenter Roeck <linux@...ck-us.net>
Subject: [PATCH] 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@...ck-us.net>
Signed-off-by: Philipp Stanner <phasta@...nel.org>
---
drivers/pci/devres.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pci/devres.c b/drivers/pci/devres.c
index 9f4190501395..f075e7881c3a 100644
--- a/drivers/pci/devres.c
+++ b/drivers/pci/devres.c
@@ -469,9 +469,6 @@ static int pcim_add_mapping_to_legacy_table(struct pci_dev *pdev,
if (!legacy_iomap_table)
return -ENOMEM;
- /* The legacy mechanism doesn't allow for duplicate mappings. */
- WARN_ON(legacy_iomap_table[bar]);
-
legacy_iomap_table[bar] = mapping;
return 0;
--
2.49.0
Powered by blists - more mailing lists