From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnhG6-0004IH-LW for qemu-devel@nongnu.org; Thu, 30 Apr 2015 01:43:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnhG2-0005Zn-LG for qemu-devel@nongnu.org; Thu, 30 Apr 2015 01:43:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:44255 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnhG2-0005Zf-FD for qemu-devel@nongnu.org; Thu, 30 Apr 2015 01:43:34 -0400 Message-ID: <5541C104.6070109@suse.de> Date: Thu, 30 Apr 2015 07:43:32 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RESEND PATCH v4 2/4] apic: convert ->busdev.qdev casts to DEVICE() casts List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Zhu Guihua , qemu-devel@nongnu.org Cc: Peter Maydell , izumi.taku@jp.fujitsu.com, guz.fnst@cn.fujitsu.com, Paolo Bonzini , chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com Am 30.04.2015 um 03:33 schrieb Zhu Guihua: > Use DEVICE() casts to avoid accessing ICCDevice's qdev field > directly. >=20 > Signed-off-by: Zhu Guihua > --- > hw/intc/apic.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) >=20 > diff --git a/hw/intc/apic.c b/hw/intc/apic.c > index 0f97b47..00ae0ec 100644 > --- a/hw/intc/apic.c > +++ b/hw/intc/apic.c > @@ -376,7 +376,7 @@ static void apic_update_irq(APICCommonState *s) > cpu_interrupt(cpu, CPU_INTERRUPT_POLL); > } else if (apic_irq_pending(s) > 0) { > cpu_interrupt(cpu, CPU_INTERRUPT_HARD); > - } else if (!apic_accept_pic_intr(&s->busdev.qdev) || !pic_get_outp= ut(isa_pic)) { > + } else if (!apic_accept_pic_intr(DEVICE(s)) || !pic_get_output(isa= _pic)) { > cpu_reset_interrupt(cpu, CPU_INTERRUPT_HARD); > } > } > @@ -549,10 +549,10 @@ static void apic_deliver(DeviceState *dev, uint8_= t dest, uint8_t dest_mode, > =20 > static bool apic_check_pic(APICCommonState *s) > { > - if (!apic_accept_pic_intr(&s->busdev.qdev) || !pic_get_output(isa_= pic)) { > + if (!apic_accept_pic_intr(DEVICE(s)) || !pic_get_output(isa_pic)) = { > return false; > } > - apic_deliver_pic_intr(&s->busdev.qdev, 1); > + apic_deliver_pic_intr(DEVICE(s), 1); Please use a local DeviceState *dev =3D DEVICE(s); variable instead of doing the cast inline twice. Please also check the hunk above - "irq" indicates to me we need to keep QOM impact low. Otherwise patch looks good, thanks for splitting out. Not sure who is going to handle this - CC'ing Paolo. Regards, Andreas P.S. I am out of the office until Tuesday, with limited access to mail. > return true; > } > =20 --=20 SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Felix Imend=F6rffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu, Graham Norton; HRB 21284 (AG N=FCrnberg)