From patchwork Fri Feb 8 04:03:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Crosthwaite X-Patchwork-Id: 219039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B3C752C0077 for ; Fri, 8 Feb 2013 15:05:36 +1100 (EST) Received: from localhost ([::1]:50424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3fDS-0003mS-3c for incoming@patchwork.ozlabs.org; Thu, 07 Feb 2013 23:05:34 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3fCc-0002yy-CH for qemu-devel@nongnu.org; Thu, 07 Feb 2013 23:04:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U3fCJ-0003tn-63 for qemu-devel@nongnu.org; Thu, 07 Feb 2013 23:04:40 -0500 Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:19765 helo=va3outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U3fCJ-0003sO-2n for qemu-devel@nongnu.org; Thu, 07 Feb 2013 23:04:23 -0500 Received: from mail141-va3-R.bigfish.com (10.7.14.241) by VA3EHSOBE009.bigfish.com (10.7.40.29) with Microsoft SMTP Server id 14.1.225.23; Fri, 8 Feb 2013 04:04:10 +0000 Received: from mail141-va3 (localhost [127.0.0.1]) by mail141-va3-R.bigfish.com (Postfix) with ESMTP id 51C8D2C02E2; Fri, 8 Feb 2013 04:04:10 +0000 (UTC) X-Forefront-Antispam-Report: CIP:149.199.60.83; KIP:(null); UIP:(null); IPV:NLI; H:xsj-gw1; RD:unknown-60-83.xilinx.com; EFVD:NLI X-SpamScore: 1 X-BigFish: VPS1(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bhz2fh95h668h839hd24hf0ah119dh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14ddh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h906i1155h) Received-SPF: pass (mail141-va3: domain of xilinx.com designates 149.199.60.83 as permitted sender) client-ip=149.199.60.83; envelope-from=peter.crosthwaite@xilinx.com; helo=xsj-gw1 ; helo=xsj-gw1 ; Received: from mail141-va3 (localhost.localdomain [127.0.0.1]) by mail141-va3 (MessageSwitch) id 1360296248187042_14490; Fri, 8 Feb 2013 04:04:08 +0000 (UTC) Received: from VA3EHSMHS021.bigfish.com (unknown [10.7.14.249]) by mail141-va3.bigfish.com (Postfix) with ESMTP id 28F65300049; Fri, 8 Feb 2013 04:04:08 +0000 (UTC) Received: from xsj-gw1 (149.199.60.83) by VA3EHSMHS021.bigfish.com (10.7.99.31) with Microsoft SMTP Server id 14.1.225.23; Fri, 8 Feb 2013 04:04:04 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-smtp1.xilinx.com) by xsj-gw1 with esmtp (Exim 4.63) (envelope-from ) id 1U3fC0-00053H-AH; Thu, 07 Feb 2013 20:04:04 -0800 From: Peter Crosthwaite To: Date: Fri, 8 Feb 2013 14:03:49 +1000 X-Mailer: git-send-email 1.7.0.4 In-Reply-To: References: X-RCIS-Action: ALLOW MIME-Version: 1.0 Message-ID: <5f322e56-bdc7-47a6-988c-188b61578de0@VA3EHSMHS021.ehs.local> X-OriginatorOrg: xilinx.com X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 X-Received-From: 216.32.180.11 Cc: edgar.iglesias@gmail.com, aliguori@us.ibm.com, Peter Crosthwaite Subject: [Qemu-devel] [PATCH v1 2/6] a9mpcore: localised temporary init-only variables 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 The DeviceState *mptimer var in a9mp_priv_state was only used by the init function and had no reason for persistence. Made a local variable and removed from state struct. Signed-off-by: Peter Crosthwaite --- hw/a9mpcore.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/a9mpcore.c b/hw/a9mpcore.c index 673bbd8..1f6c985 100644 --- a/hw/a9mpcore.c +++ b/hw/a9mpcore.c @@ -20,7 +20,6 @@ typedef struct a9mp_priv_state { uint32_t num_cpu; MemoryRegion scu_iomem; MemoryRegion container; - DeviceState *mptimer; DeviceState *gic; uint32_t num_irq; } a9mp_priv_state; @@ -130,6 +129,7 @@ static int a9mp_priv_init(SysBusDevice *dev) { a9mp_priv_state *s = FROM_SYSBUS(a9mp_priv_state, dev); SysBusDevice *busdev, *gicbusdev; + DeviceState *qdev; int i; s->gic = qdev_create(NULL, "arm_gic"); @@ -144,10 +144,10 @@ static int a9mp_priv_init(SysBusDevice *dev) /* Pass through inbound GPIO lines to the GIC */ qdev_init_gpio_in(&s->busdev.qdev, a9mp_priv_set_irq, s->num_irq - 32); - s->mptimer = qdev_create(NULL, "arm_mptimer"); - qdev_prop_set_uint32(s->mptimer, "num-cpu", s->num_cpu); - qdev_init_nofail(s->mptimer); - busdev = SYS_BUS_DEVICE(s->mptimer); + qdev = qdev_create(NULL, "arm_mptimer"); + qdev_prop_set_uint32(qdev, "num-cpu", s->num_cpu); + qdev_init_nofail(qdev); + busdev = SYS_BUS_DEVICE(qdev); /* Memory map (addresses are offsets from PERIPHBASE): * 0x0000-0x00ff -- Snoop Control Unit