From: Bjorn Helgaas <helgaas@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
"Logan Odell" <loganodell@google.com>,
"Arnd Bergmann" <arnd@arndb.de>, "Dan Williams" <djbw@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@oss.qualcomm.com>,
"David Matlack" <dmatlack@google.com>,
"Håkon Bugge" <haakon.bugge@oracle.com>,
"Terry Bowman" <terry.bowman@amd.com>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI/IOV: fix building without CONFIG_PCI_IOV
Date: Mon, 28 Sep 2026 17:26:50 -0500 [thread overview]
Message-ID: <20260928222650.GA2268446@bhelgaas> (raw)
In-Reply-To: <20260928161811.2846627-1-arnd@kernel.org>
On Mon, Sep 28, 2026 at 06:16:39PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The newly added code dealing with virtual functions causes
> a harmless build warning:
>
> drivers/pci/probe.c: In function 'pci_class':
> drivers/pci/probe.c:1902:12: error: unused variable 'rev' [-Werror=unused-variable]
>
> Move the unused variable into the #ifdef block that uses it.
>
> Fixes: 8a2a9fa37b81 ("PCI/IOV: Read VF config values that need not match PF")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks, I fixed this similarly:
https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=virtualization
#ifdef CONFIG_PCI_IOV
- if (dev->is_virtfn)
- return dev->physfn->sriov->class;
+ if (dev->is_virtfn) {
+ u8 rev;
+
+ if (pci_read_config_byte(dev, PCI_REVISION_ID, &rev))
+ rev = 0;
+ return (dev->physfn->class << 8) | rev;
+ }
#endif
> ---
> drivers/pci/probe.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 833ce364f880..1ff07c592857 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -1899,9 +1899,9 @@ int pci_cfg_space_size(struct pci_dev *dev)
> static u32 pci_class(struct pci_dev *dev)
> {
> u32 class;
> +#ifdef CONFIG_PCI_IOV
> u8 rev;
>
> -#ifdef CONFIG_PCI_IOV
> if (dev->is_virtfn) {
> if (pci_read_config_byte(dev, PCI_REVISION_ID, &rev))
> rev = 0;
> --
> 2.53.0
>
prev parent reply other threads:[~2026-09-28 22:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 16:16 Arnd Bergmann
2026-09-28 22:26 ` 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=20260928222650.GA2268446@bhelgaas \
--to=helgaas@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=bhelgaas@google.com \
--cc=djbw@kernel.org \
--cc=dmatlack@google.com \
--cc=haakon.bugge@oracle.com \
--cc=hkallweit1@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=loganodell@google.com \
--cc=manivannan.sadhasivam@oss.qualcomm.com \
--cc=terry.bowman@amd.com \
/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
all inboxes | Powered by JetHome®