From: "Andreas Färber" <afaerber@suse.de>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
izumi.taku@jp.fujitsu.com, guz.fnst@cn.fujitsu.com,
Paolo Bonzini <pbonzini@redhat.com>,
chen.fan.fnst@cn.fujitsu.com, imammedo@redhat.com
Subject: Re: [Qemu-devel] [RESEND PATCH v4 2/4] apic: convert ->busdev.qdev casts to DEVICE() casts
Date: Thu, 30 Apr 2015 07:43:32 +0200 [thread overview]
Message-ID: <5541C104.6070109@suse.de> (raw)
In-Reply-To: <beef2063a3890eae73ac679aa04ccf654a9e8d10.1430357187.git.zhugh.fnst@cn.fujitsu.com>
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.
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;
> }
>
--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2015-04-30 5:43 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 [this message]
2015-04-30 13:42 ` Paolo Bonzini
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=5541C104.6070109@suse.de \
--to=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=pbonzini@redhat.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.