Skip to content

Commit 0f3feef

Browse files
CV-Bowenxiaoxiang781216
authored andcommitted
drivers/pci/pci.c: fix warning when CONFIG_PCI_ASSIGN_ALL_BUSES=n
pci/pci.c:415:34: warning: variable ‘res’ set but not used [-Wunused-but-set-variable] 415 | FAR struct pci_resource_s *res; | ^~~ pci/pci.c: In function ‘pci_scan_bus’: pci/pci.c:663:32: warning: unused variable ‘ctrl’ [-Wunused-variable] 663 | FAR struct pci_controller_s *ctrl = bus->ctrl; Signed-off-by: Bowen Wang <[email protected]>
1 parent 53bbf79 commit 0f3feef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/pci/pci.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,8 @@ static void pci_setup_device(FAR struct pci_device_s *dev, int max_bar,
689689
pci_read_config_byte(dev, PCI_COMMAND, &cmd);
690690
pci_write_config_byte(dev, PCI_COMMAND,
691691
cmd & ~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY);
692+
#else
693+
uint32_t tmp;
692694
#endif
693695

694696
for (bar = 0; bar < max_bar; bar++)
@@ -762,8 +764,6 @@ static void pci_setup_device(FAR struct pci_device_s *dev, int max_bar,
762764
res->start += size;
763765
#else
764766
UNUSED(res);
765-
uint32_t tmp;
766-
767767
pci_read_config_dword(dev, base_address_0, &tmp);
768768
if (mask & PCI_BASE_ADDRESS_SPACE_IO)
769769
{
@@ -1040,7 +1040,7 @@ static void pci_scan_bus(FAR struct pci_bus_s *bus)
10401040
child_bus->parent_bus = bus;
10411041

10421042
#ifdef CONFIG_PCI_ASSIGN_ALL_BUSES
1043-
child_bus->number = ctrl->busno++;
1043+
child_bus->number = bus->ctrl->busno++;
10441044
#endif
10451045

10461046
list_add_tail(&bus->children, &child_bus->node);

0 commit comments

Comments
 (0)