PCI: fix unused variable warning
PATCH 1/1 PCI: fix unused variable warning
The newly introduced function produces a warning without CONFIG_PCI_QUIRKS:
drivers/pci/probe.c: In function 'pci_bus_read_dev_vendor_id':drivers/pci/probe.c:2221:18: error: unused variable 'bridge' [-Werror=unused-variable]
Move the variable declaration into that #ifdef to avoid the warning.
Fixes ac5ea104a279 ("PCI: Workaround IDT switch ACS Source Validation erratum")
Signed-off-by Arnd Bergmann <[email protected]>
--- drivers/pci/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/probe.c +1 -1
@@ -2218,9 +2218,9 @@ bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,bool pci_bus_read_dev_vendor_id (struct pci_bus *bus,int devfn,u32 *l,int timeout) { +#ifdef CONFIG_PCI_QUIRKS struct pci_dev *bridge = bus->self; -#ifdef CONFIG_PCI_QUIRKS /* * Certain IDT switches have an issue where they improperly trigger * ACS Source Validation errors on completions for config reads.
Signature · 1 line
2.18.0
Bjorn Helgaas
maintainer[+cc Anders]
Quoted 10 lines · Arnd Bergmann
The newly introduced function produces a warning without
CONFIG_PCI_QUIRKS:
drivers/pci/probe.c: In function 'pci_bus_read_dev_vendor_id':drivers/pci/probe.c:2221:18: error: unused variable 'bridge' [-Werror=unused-variable]Move the variable declaration into that #ifdef to avoid the warning.
Fixes ac5ea104a279 ("PCI: Workaround IDT switch ACS Source Validation erratum")Signed-off-by Arnd Bergmann <[email protected]>
Fixed already with a patch from Anders Roxell
<[email protected]>, thanks!
Quoted 22 lines
--- drivers/pci/probe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pci/probe.c +1
-2@@ -2218,9 +2218,9 @@ bool pci_bus_generic_read_dev_vendor_id(struct pci_bus *bus, int devfn, u32 *l,bool pci_bus_read_dev_vendor_id (struct pci_bus *bus,int devfn,u32 *l,int timeout) { +#ifdef CONFIG_PCI_QUIRKS struct pci_dev *bridge = bus->self; -#ifdef CONFIG_PCI_QUIRKS /* * Certain IDT switches have an issue where they improperly trigger * ACS Source Validation errors on completions for config reads. -- 2.18.0