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 <wangbowen6@xiaomi.com>
This commit is contained in:
Bowen Wang 2024-03-07 16:49:25 +08:00 committed by Mateusz Szafoni
parent 519c5c86aa
commit 1407a44862

View File

@ -681,6 +681,8 @@ static void pci_setup_device(FAR struct pci_device_s *dev, int max_bar,
pci_read_config_byte(dev, PCI_COMMAND, &cmd);
pci_write_config_byte(dev, PCI_COMMAND,
cmd & ~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY);
#else
uint32_t tmp;
#endif
for (bar = 0; bar < max_bar; bar++)
@ -754,8 +756,6 @@ static void pci_setup_device(FAR struct pci_device_s *dev, int max_bar,
res->start += size;
#else
UNUSED(res);
uint32_t tmp;
pci_read_config_dword(dev, base_address_0, &tmp);
if (mask & PCI_BASE_ADDRESS_SPACE_IO)
{
@ -1032,7 +1032,7 @@ static void pci_scan_bus(FAR struct pci_bus_s *bus)
child_bus->parent_bus = bus;
#ifdef CONFIG_PCI_ASSIGN_ALL_BUSES
child_bus->number = ctrl->busno++;
child_bus->number = bus->ctrl->busno++;
#endif
list_add_tail(&bus->children, &child_bus->node);