All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>,
	"Zhu Guihua" <zhugh.fnst@cn.fujitsu.com>,
	qemu-devel@nongnu.org
Cc: chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com,
	Peter Maydell <peter.maydell@linaro.org>,
	guz.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com
Subject: Re: [Qemu-devel] [RESEND PATCH v4 2/4] apic: convert ->busdev.qdev casts to DEVICE() casts
Date: Thu, 30 Apr 2015 15:42:19 +0200	[thread overview]
Message-ID: <5542313B.3080609@redhat.com> (raw)
In-Reply-To: <5541C104.6070109@suse.de>



On 30/04/2015 07:43, Andreas Färber wrote:
> Am 30.04.2015 um 03:33 schrieb Zhu Guihua:
>> > Use DEVICE() casts to avoid accessing ICCDevice's qdev field
>> > directly.
>> > 
>> > Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
>> > ---
>> >  hw/intc/apic.c | 6 +++---
>> >  1 file changed, 3 insertions(+), 3 deletions(-)
>> > 
>> > 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_output(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,
>> >  
>> >  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 = 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.

Yes, it's probably better to use a C cast here, so "DeviceState *dev =
(DeviceState *)s;".

Paolo

> Otherwise patch looks good, thanks for splitting out.
> Not sure who is going to handle this - CC'ing Paolo.

  reply	other threads:[~2015-04-30 13:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-30  1:33 [Qemu-devel] [RESEND PATCH v4 0/4] remove icc bus/bridge Zhu Guihua
2015-04-30  1:33 ` [Qemu-devel] [RESEND PATCH v4 1/4] apic: move apic mmio register to each apic realizefn Zhu Guihua
2015-04-30  1:33 ` [Qemu-devel] [RESEND PATCH v4 2/4] apic: convert ->busdev.qdev casts to DEVICE() casts Zhu Guihua
2015-04-30  5:43   ` Andreas Färber
2015-04-30 13:42     ` Paolo Bonzini [this message]
2015-04-30  1:33 ` [Qemu-devel] [RESEND PATCH v4 3/4] cpu/apic: drop icc bus/bridge/ Zhu Guihua
2015-04-30  5:55   ` Andreas Färber
2015-04-30  1:33 ` [Qemu-devel] [RESEND PATCH v4 4/4] icc_bus: drop the unused files Zhu Guihua

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=5542313B.3080609@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhugh.fnst@cn.fujitsu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.