From patchwork Wed May 13 07:11:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Guihua X-Patchwork-Id: 471722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8A935140D22 for ; Wed, 13 May 2015 17:12:43 +1000 (AEST) Received: from localhost ([::1]:46805 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsQqO-0003yR-KH for incoming@patchwork.ozlabs.org; Wed, 13 May 2015 03:12:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsQps-00034L-4W for qemu-devel@nongnu.org; Wed, 13 May 2015 03:12:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YsQpo-0007WY-5R for qemu-devel@nongnu.org; Wed, 13 May 2015 03:12:08 -0400 Received: from [59.151.112.132] (port=42414 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YsQpn-0007VQ-L0 for qemu-devel@nongnu.org; Wed, 13 May 2015 03:12:04 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="92085477" Received: from localhost (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 13 May 2015 15:08:05 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t4D7Aevs021066; Wed, 13 May 2015 15:10:40 +0800 Received: from G08FNSTD140041.g08.fujitsu.local (10.167.226.252) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Wed, 13 May 2015 15:12:05 +0800 From: Zhu Guihua To: , , , , Date: Wed, 13 May 2015 15:11:15 +0800 Message-ID: <0051827ad57821b4ca512d60958f820ee8b471d6.1431500428.git.zhugh.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.167.226.252] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: chen.fan.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com, Zhu Guihua , guz.fnst@cn.fujitsu.com Subject: [Qemu-devel] [PATCH v5 2/4] apic: convert ->busdev.qdev casts to C casts X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Use C casts to avoid accessing ICCDevice's qdev field directly. Signed-off-by: Zhu Guihua --- 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)) { 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; }