hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled
When CONFIG_IDE_ISA is disabled, compilation currently fails:
hw/i386/pc_piix.c: In function ‘pc_init1’:
hw/i386/pc_piix.c:81:9: error: unused variable ‘i’ [-Werror=unused-variable]
Move the variable declaration to the right code block to avoid
this problem.
Fixes: 4501d317b5
("hw/i386/pc: Extract pc_i8259_create()")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20191115145049.26868-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
7fac38635e
commit
c9d6da3a5e
|
@ -78,7 +78,6 @@ static void pc_init1(MachineState *machine,
|
||||||
X86MachineState *x86ms = X86_MACHINE(machine);
|
X86MachineState *x86ms = X86_MACHINE(machine);
|
||||||
MemoryRegion *system_memory = get_system_memory();
|
MemoryRegion *system_memory = get_system_memory();
|
||||||
MemoryRegion *system_io = get_system_io();
|
MemoryRegion *system_io = get_system_io();
|
||||||
int i;
|
|
||||||
PCIBus *pci_bus;
|
PCIBus *pci_bus;
|
||||||
ISABus *isa_bus;
|
ISABus *isa_bus;
|
||||||
PCII440FXState *i440fx_state;
|
PCII440FXState *i440fx_state;
|
||||||
|
@ -253,7 +252,8 @@ static void pc_init1(MachineState *machine,
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_IDE_ISA
|
#ifdef CONFIG_IDE_ISA
|
||||||
else {
|
else {
|
||||||
for(i = 0; i < MAX_IDE_BUS; i++) {
|
int i;
|
||||||
|
for (i = 0; i < MAX_IDE_BUS; i++) {
|
||||||
ISADevice *dev;
|
ISADevice *dev;
|
||||||
char busname[] = "ide.0";
|
char busname[] = "ide.0";
|
||||||
dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i],
|
dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i],
|
||||||
|
|
Loading…
Reference in New Issue