From: Bjorn Helgaas <helgaas@kernel.org>
To: Philipp Stanner <phasta@kernel.org>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] PCI: Remove useless WARN_ON() from devres
Date: Wed, 14 Jan 2026 11:00:59 -0600 [thread overview]
Message-ID: <20260114170059.GA822278@bhelgaas> (raw)
In-Reply-To: <20251218092819.149665-2-phasta@kernel.org>
On Thu, Dec 18, 2025 at 10:28:20AM +0100, Philipp Stanner wrote:
> 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>
Applied to pci/misc for v6.20, thanks!
> ---
> 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
>
prev parent reply other threads:[~2026-01-14 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 9:28 [PATCH] PCI: Remove useless WARN_ON() from devres Philipp Stanner
2026-01-14 13:10 ` Philipp Stanner
2026-01-14 17:00 ` Bjorn Helgaas [this message]
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=20260114170059.GA822278@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=phasta@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox