Message ID | AANLkTinQ_6EB4oneEUBCGEFmnDUgzkbxWwU-4d1RLyZd@mail.gmail.com |
---|---|
State | New |
Headers | show |
Blue Swirl <blauwirbel@gmail.com> writes: > Compiling with GCC 4.6.0 20100925 produced warnings like: > /src/qemu/hw/mips_fulong2e.c: In function 'mips_fulong2e_init': > /src/qemu/hw/mips_fulong2e.c:274:16: error: variable 'rtc_state' set > but not used [-Werror=unused-but-set-variable] > /src/qemu/hw/mips_fulong2e.c:268:16: error: variable 'isa_dev' set but > not used [-Werror=unused-but-set-variable] > /src/qemu/hw/mips_fulong2e.c:261:19: error: variable 'ram_offset' set > but not used [-Werror=unused-but-set-variable] > > Fix by removing the unused variables. > > Instead of removing, fix ram_offset use. That part looks like a bug fix to me! Suggest to put it in its own commit, with a commit message describing its impact.
diff --git a/hw/mips_fulong2e.c b/hw/mips_fulong2e.c index df80ef6..d7d1629 100644 --- a/hw/mips_fulong2e.c +++ b/hw/mips_fulong2e.c @@ -265,13 +265,11 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device, qemu_irq *cpu_exit_irq; int via_devfn; PCIBus *pci_bus; - ISADevice *isa_dev; uint8_t *eeprom_buf; i2c_bus *smbus; int i; DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; DeviceState *eeprom; - ISADevice *rtc_state; CPUState *env;
Compiling with GCC 4.6.0 20100925 produced warnings like: /src/qemu/hw/mips_fulong2e.c: In function 'mips_fulong2e_init': /src/qemu/hw/mips_fulong2e.c:274:16: error: variable 'rtc_state' set but not used [-Werror=unused-but-set-variable] /src/qemu/hw/mips_fulong2e.c:268:16: error: variable 'isa_dev' set but not used [-Werror=unused-but-set-variable] /src/qemu/hw/mips_fulong2e.c:261:19: error: variable 'ram_offset' set but not used [-Werror=unused-but-set-variable] Fix by removing the unused variables. Instead of removing, fix ram_offset use. Signed-off-by: Blue Swirl <blauwirbel@gmail.com> --- hw/mips_fulong2e.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) /* init CPUs */ @@ -297,7 +295,7 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device, ram_offset = qemu_ram_alloc(NULL, "fulong2e.ram", ram_size); bios_offset = qemu_ram_alloc(NULL, "fulong2e.bios", bios_size); - cpu_register_physical_memory(0, ram_size, IO_MEM_RAM); + cpu_register_physical_memory(0, ram_size, ram_offset | IO_MEM_RAM); cpu_register_physical_memory(0x1fc00000LL, bios_size, bios_offset | IO_MEM_ROM); @@ -378,9 +376,9 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device, DMA_init(0, cpu_exit_irq); /* Super I/O */ - isa_dev = isa_create_simple("i8042"); + isa_create_simple("i8042"); - rtc_state = rtc_init(2000, NULL); + rtc_init(2000, NULL); for(i = 0; i < MAX_SERIAL_PORTS; i++) { if (serial_hds[i]) {