qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Thomas Huth <thuth@redhat.com>
Subject: [PULL 05/12] hw/i386: Fix compiler warning when CONFIG_IDE_ISA is disabled
Date: Tue, 19 Nov 2019 17:08:41 +0100	[thread overview]
Message-ID: <1574179728-35535-6-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1574179728-35535-1-git-send-email-pbonzini@redhat.com>

From: Thomas Huth <thuth@redhat.com>

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: 4501d317b50e ("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>
---
 hw/i386/pc_piix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 2aefa3b..849ee12 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -78,7 +78,6 @@ static void pc_init1(MachineState *machine,
     X86MachineState *x86ms = X86_MACHINE(machine);
     MemoryRegion *system_memory = get_system_memory();
     MemoryRegion *system_io = get_system_io();
-    int i;
     PCIBus *pci_bus;
     ISABus *isa_bus;
     PCII440FXState *i440fx_state;
@@ -253,7 +252,8 @@ static void pc_init1(MachineState *machine,
     }
 #ifdef CONFIG_IDE_ISA
 else {
-        for(i = 0; i < MAX_IDE_BUS; i++) {
+        int i;
+        for (i = 0; i < MAX_IDE_BUS; i++) {
             ISADevice *dev;
             char busname[] = "ide.0";
             dev = isa_ide_init(isa_bus, ide_iobase[i], ide_iobase2[i],
-- 
1.8.3.1




  parent reply	other threads:[~2019-11-19 16:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 16:08 [PULL 00/12] Misc patches for QEMU 4.2-rc Paolo Bonzini
2019-11-19 16:08 ` [PULL 01/12] scripts: Detect git worktrees for get_maintainer.pl --git Paolo Bonzini
2019-11-19 16:08 ` [PULL 02/12] microvm: fix memory leak in microvm_fix_kernel_cmdline Paolo Bonzini
2019-11-19 16:08 ` [PULL 03/12] target/i386: add PSCHANGE_NO bit for the ARCH_CAPABILITIES MSR Paolo Bonzini
2019-11-19 16:08 ` [PULL 04/12] target/i386: Export TAA_NO bit to guests Paolo Bonzini
2019-11-19 16:08 ` Paolo Bonzini [this message]
2019-11-19 16:08 ` [PULL 06/12] vfio: vfio-pci requires EDID Paolo Bonzini
2019-11-19 16:08 ` [PULL 07/12] docs/microvm.rst: fix alignment in "Limitations" Paolo Bonzini
2019-11-19 16:08 ` [PULL 08/12] docs/microvm.rst: add instructions for shutting down the guest Paolo Bonzini
2019-11-19 16:08 ` [PULL 09/12] hw/i386: Move save_tsc_khz from PCMachineClass to X86MachineClass Paolo Bonzini
2019-11-19 16:08 ` [PULL 10/12] scsi: deprecate scsi-disk Paolo Bonzini
2019-11-19 16:08 ` [PULL 11/12] Revert "mc146818rtc: fix timer interrupt reinjection" Paolo Bonzini
2019-11-19 16:08 ` [PULL 12/12] mc146818rtc: fix timer interrupt reinjection again Paolo Bonzini
2019-11-19 18:30 ` [PULL 00/12] Misc patches for QEMU 4.2-rc Peter Maydell
2019-11-20  2:00 ` no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1574179728-35535-6-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).