[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250210195658.GK32480@redhat.com>
Date: Mon, 10 Feb 2025 20:56:59 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Alex Williamson <alex.williamson@...hat.com>
Cc: bhelgaas@...gle.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, mitchell.augustin@...onical.com,
ilpo.jarvinen@...ux.intel.com
Subject: Re: [PATCH v2] PCI: Batch BAR sizing operations
On 02/10, Alex Williamson wrote:
>
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -345,7 +345,8 @@ static void pci_read_bases(struct pci_dev *dev, unsigned int howmany, int rom)
> unsigned int pos, reg;
> u16 orig_cmd;
>
> - BUILD_BUG_ON(howmany > PCI_STD_NUM_BARS);
> + if (__builtin_constant_p(howmany))
> + BUILD_BUG_ON(howmany > PCI_STD_NUM_BARS);
Or just
BUILD_BUG_ON(__builtin_constant_p(howmany) && howmany > PCI_STD_NUM_BARS);
I dunno... Works for me in any case.
I don't know if this is "right" solution though, but I can't suggest
anything better.
Oleg.
Powered by blists - more mailing lists