qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Cc: ehabkost@redhat.com, qemu-devel@nongnu.org,
	guz.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com,
	chen.fan.fnst@cn.fujitsu.com, pbonzini@redhat.com,
	afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v5 2/4] apic: convert ->busdev.qdev casts to C casts
Date: Fri, 15 May 2015 17:38:15 +0200	[thread overview]
Message-ID: <20150515173815.6fce8f87@nial.brq.redhat.com> (raw)
In-Reply-To: <0051827ad57821b4ca512d60958f820ee8b471d6.1431500428.git.zhugh.fnst@cn.fujitsu.com>

On Wed, 13 May 2015 15:11:15 +0800
Zhu Guihua <zhugh.fnst@cn.fujitsu.com> wrote:

> Use C casts to avoid accessing ICCDevice's qdev field
> directly.
> 
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
> ---
>  hw/intc/apic.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/hw/intc/apic.c b/hw/intc/apic.c
> index 0f97b47..e6f14b5 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)) {
do here the same as below, i.e. don't use QOM cast.

>          cpu_reset_interrupt(cpu, CPU_INTERRUPT_HARD);
>      }
>  }
> @@ -549,10 +549,12 @@ 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)) {
> +    DeviceState *dev = (DeviceState *)s;
> +
> +    if (!apic_accept_pic_intr(dev) || !pic_get_output(isa_pic)) {
>          return false;
>      }
> -    apic_deliver_pic_intr(&s->busdev.qdev, 1);
> +    apic_deliver_pic_intr(dev, 1);
>      return true;
>  }
>  

  reply	other threads:[~2015-05-15 15:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  7:11 [Qemu-devel] [PATCH v5 0/4] remove icc bus/bridge Zhu Guihua
2015-05-13  7:11 ` [Qemu-devel] [PATCH v5 1/4] apic: move apic mmio register to each apic realizefn Zhu Guihua
2015-05-15 15:48   ` Igor Mammedov
2015-05-13  7:11 ` [Qemu-devel] [PATCH v5 2/4] apic: convert ->busdev.qdev casts to C casts Zhu Guihua
2015-05-15 15:38   ` Igor Mammedov [this message]
2015-05-13  7:11 ` [Qemu-devel] [PATCH v5 3/4] cpu/apic: drop icc bus/bridge Zhu Guihua
2015-05-15 16:12   ` Igor Mammedov
2015-05-13  7:11 ` [Qemu-devel] [PATCH v5 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=20150515173815.6fce8f87@nial.brq.redhat.com \
    --to=imammedo@redhat.com \
    --cc=afaerber@suse.de \
    --cc=chen.fan.fnst@cn.fujitsu.com \
    --cc=ehabkost@redhat.com \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=izumi.taku@jp.fujitsu.com \
    --cc=pbonzini@redhat.com \
    --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 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).