From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39377) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv0jM-0004li-Ql for qemu-devel@nongnu.org; Wed, 20 May 2015 05:56:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yv0jH-0005Pe-R3 for qemu-devel@nongnu.org; Wed, 20 May 2015 05:56:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yv0jH-0005PP-Ic for qemu-devel@nongnu.org; Wed, 20 May 2015 05:55:59 -0400 Message-ID: <555C5A29.8090106@redhat.com> Date: Wed, 20 May 2015 11:55:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] pc_init1: Don't misuse int for holding up a bool List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michal Privoznik , qemu-devel@nongnu.org Cc: Eduardo Habkost , rth@twiddle.net On 20/05/2015 11:15, Michal Privoznik wrote: > When going through code I realized, that the pc_init1() has this two > arguments @pci_enabled and @kvmclock_enabled which despite used as > booleans are of int type. > > Signed-off-by: Michal Privoznik Eduardo, do your patches to the PC machine types subsume this change? Paolo > --- > hw/i386/pc_piix.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index 212e263..97650b0 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386/pc_piix.c > @@ -74,8 +74,8 @@ static bool has_reserved_memory = true; > > /* PC hardware initialisation */ > static void pc_init1(MachineState *machine, > - int pci_enabled, > - int kvmclock_enabled) > + bool pci_enabled, > + bool kvmclock_enabled) > { > PCMachineState *pc_machine = PC_MACHINE(machine); > MemoryRegion *system_memory = get_system_memory(); > @@ -307,7 +307,7 @@ static void pc_init1(MachineState *machine, > > static void pc_init_pci(MachineState *machine) > { > - pc_init1(machine, 1, 1); > + pc_init1(machine, true, true); > } > > static void pc_compat_2_3(MachineState *machine) > @@ -483,7 +483,7 @@ static void pc_init_pci_1_2(MachineState *machine) > static void pc_init_pci_no_kvmclock(MachineState *machine) > { > pc_compat_1_2(machine); > - pc_init1(machine, 1, 0); > + pc_init1(machine, true, false); > } > > static void pc_init_isa(MachineState *machine) > @@ -500,7 +500,7 @@ static void pc_init_isa(MachineState *machine) > } > x86_cpu_compat_kvm_no_autoenable(FEAT_KVM, 1 << KVM_FEATURE_PV_EOI); > enable_compat_apic_id_mode(); > - pc_init1(machine, 0, 1); > + pc_init1(machine, false, true); > } > > #ifdef CONFIG_XEN >