All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Stanner <phasta@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Philipp Stanner <phasta@kernel.org>,
	Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH] PCI: Remove useless WARN_ON() from devres
Date: Thu, 18 Dec 2025 10:28:20 +0100	[thread overview]
Message-ID: <20251218092819.149665-2-phasta@kernel.org> (raw)

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>
---
 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


             reply	other threads:[~2025-12-18  9:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  9:28 Philipp Stanner [this message]
2026-01-14 13:10 ` [PATCH] PCI: Remove useless WARN_ON() from devres Philipp Stanner
2026-01-14 17:00 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251218092819.149665-2-phasta@kernel.org \
    --to=phasta@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.