Skip to content

Commit 0f1103e

Browse files
Yinghai Lubjorn-helgaas
authored andcommitted
x86/PCI: fix unused variable warning in amd_bus.c
Fix this warning: arch/x86/pci/amd_bus.c: In function 'early_fill_mp_bus_info': arch/x86/pci/amd_bus.c:56:6: warning: unused variable 'j' [-Wunused-variable] introduced by commit d28e5ac ("x86/PCI: dynamically allocate pci_root_info for native host bridge drivers"). Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Yinghai Lu <yinghai@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 29473ec commit 0f1103e

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

‎arch/x86/pci/amd_bus.c‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ static struct pci_root_info __init *find_pci_root_info(int node, int link)
4444
return NULL;
4545
}
4646

47+
static void __init set_mp_bus_range_to_node(int min_bus, int max_bus, int node)
48+
{
49+
#ifdef CONFIG_NUMA
50+
int j;
51+
52+
for (j = min_bus; j <= max_bus; j++)
53+
set_mp_bus_to_node(j, node);
54+
#endif
55+
}
4756
/**
4857
* early_fill_mp_bus_to_node()
4958
* called before pcibios_scan_root and pci_scan_bus
@@ -53,7 +62,6 @@ static struct pci_root_info __init *find_pci_root_info(int node, int link)
5362
static int __init early_fill_mp_bus_info(void)
5463
{
5564
int i;
56-
int j;
5765
unsigned bus;
5866
unsigned slot;
5967
int node;
@@ -109,10 +117,7 @@ static int __init early_fill_mp_bus_info(void)
109117
min_bus = (reg >> 16) & 0xff;
110118
max_bus = (reg >> 24) & 0xff;
111119
node = (reg >> 4) & 0x07;
112-
#ifdef CONFIG_NUMA
113-
for (j = min_bus; j <= max_bus; j++)
114-
set_mp_bus_to_node(j, node);
115-
#endif
120+
set_mp_bus_range_to_node(min_bus, max_bus, node);
116121
link = (reg >> 8) & 0x03;
117122

118123
info = alloc_pci_root_info(min_bus, max_bus, node, link);

0 commit comments

Comments
 (0)