mirror of
https://github.com/apache/nuttx.git
synced 2026-10-04 12:48:09 +00:00
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:
parent
53bbf797da
commit
0f3feefa85
1 changed files with 3 additions and 3 deletions
|
|
@ -689,6 +689,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++)
|
||||
|
|
@ -762,8 +764,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)
|
||||
{
|
||||
|
|
@ -1040,7 +1040,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue