From patchwork Wed Jun 3 13:08:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 49473 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7925620BE7 for ; Wed, 3 Jun 2015 14:27:47 +0000 (UTC) Received: by lbbqq2 with SMTP id qq2sf3216184lbb.0 for ; Wed, 03 Jun 2015 07:27:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:date :message-id:in-reply-to:references:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=6Kromdssqx+WE3QJGg0ivpp3oyyr6gQo9KpiNcr6Zzk=; b=nC1I6tKCqXCW4zmALOB8w55lUTHJlIzMw/WU0r2MAn2s6dhXTTK/0s7S0aUX/rAAgq NruLOHnVbDH0wRIUFOLipw1nLzkj8Zfun1rcB2EkqqqPz8ulLnK4dZp52Nh8mUGkZp1b cRa3OOQC31ryC1oupV1Aa+v+M4xxTFfYwfoJLYaj5O2PbOggh+AAO4BTKOkxmQ2MlCa5 gxtCtIKFnOiCwmAIVcBilcQdQ5DcvsGJdsRPuosRqgm+Bw3J30Rb9DonG5gdS6dNfFFi U4yYHNZBKt5qJaoAfiEa6OMJgU9+Da7k5Z4i/cXVPIgpIYyQP/iIfo8coomAyhkORQhO Eyig== X-Gm-Message-State: ALoCoQlmNK4tZ9/6d0E2nilWzPPyuIJoZc4ir1VcnPTgwLhbqe6rk64ExOUcjxhHPT4T5R9CS27q X-Received: by 10.112.166.137 with SMTP id zg9mr31016765lbb.11.1433341666338; Wed, 03 Jun 2015 07:27:46 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.105 with SMTP id lb9ls69235lab.10.gmail; Wed, 03 Jun 2015 07:27:46 -0700 (PDT) X-Received: by 10.152.2.2 with SMTP id 2mr8054246laq.58.1433341666194; Wed, 03 Jun 2015 07:27:46 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id ug12si18175594lac.47.2015.06.03.07.27.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 07:27:46 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbcmx3 with SMTP id mx3so8185062lbc.1 for ; Wed, 03 Jun 2015 07:27:46 -0700 (PDT) X-Received: by 10.112.219.70 with SMTP id pm6mr31659940lbc.41.1433341666062; Wed, 03 Jun 2015 07:27:46 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.108.230 with SMTP id hn6csp3908702lbb; Wed, 3 Jun 2015 07:27:45 -0700 (PDT) X-Received: by 10.140.44.52 with SMTP id f49mr35489330qga.88.1433341662909; Wed, 03 Jun 2015 07:27:42 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 139si740047qhh.63.2015.06.03.07.27.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 03 Jun 2015 07:27:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:35876 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09dt-0004qj-H8 for patch@linaro.org; Wed, 03 Jun 2015 10:27:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09cu-0003jw-S3 for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:26:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z09cq-0006vz-Nl for qemu-devel@nongnu.org; Wed, 03 Jun 2015 10:26:40 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:46804) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z09cq-0006vV-Gb; Wed, 03 Jun 2015 10:26:36 -0400 Received: from tsrv.tls.msk.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id E23F2407C5; Wed, 3 Jun 2015 17:26:33 +0300 (MSK) Received: from tls.msk.ru (mjt.vpn.tls.msk.ru [192.168.177.99]) by tsrv.tls.msk.ru (Postfix) with SMTP id 4CC06A6C; Wed, 3 Jun 2015 16:08:55 +0300 (MSK) Received: (nullmailer pid 27441 invoked by uid 1000); Wed, 03 Jun 2015 13:08:52 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Date: Wed, 3 Jun 2015 16:08:34 +0300 Message-Id: <0b0cc076b78976b30360dd7c6ed994f864424779.1433336870.git.mjt@msgid.tls.msk.ru> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 86.62.121.231 Cc: qemu-trivial@nongnu.org, Michael Tokarev , Shannon Zhao , Shannon Zhao Subject: [Qemu-devel] [PULL 14/30] hw/i386/pc: Fix misusing qemu_allocate_irqs for single irq 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mjt@tls.msk.ru X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Shannon Zhao Since pc_allocate_cpu_irq only requests one irq, so let it just call qemu_allocate_irq. Signed-off-by: Shannon Zhao Signed-off-by: Shannon Zhao Signed-off-by: Michael Tokarev --- hw/i386/pc.c | 4 ++-- hw/i386/pc_piix.c | 4 +--- hw/i386/pc_q35.c | 4 +--- include/hw/i386/pc.h | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 1eb1db0..886151b 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1345,9 +1345,9 @@ FWCfgState *pc_memory_init(MachineState *machine, return fw_cfg; } -qemu_irq *pc_allocate_cpu_irq(void) +qemu_irq pc_allocate_cpu_irq(void) { - return qemu_allocate_irqs(pic_irq_request, NULL, 1); + return qemu_allocate_irq(pic_irq_request, NULL, 0); } DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 8d949a3..768b09b 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -86,7 +86,6 @@ static void pc_init1(MachineState *machine) ISABus *isa_bus; PCII440FXState *i440fx_state; int piix3_devfn = -1; - qemu_irq *cpu_irq; qemu_irq *gsi; qemu_irq *i8259; qemu_irq smi_irq; @@ -220,8 +219,7 @@ static void pc_init1(MachineState *machine) } else if (xen_enabled()) { i8259 = xen_interrupt_controller_init(); } else { - cpu_irq = pc_allocate_cpu_irq(); - i8259 = i8259_init(isa_bus, cpu_irq[0]); + i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq()); } for (i = 0; i < ISA_NUM_IRQS; i++) { diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 66220b3..110dfb7 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -79,7 +79,6 @@ static void pc_q35_init(MachineState *machine) GSIState *gsi_state; ISABus *isa_bus; int pci_enabled = 1; - qemu_irq *cpu_irq; qemu_irq *gsi; qemu_irq *i8259; int i; @@ -230,8 +229,7 @@ static void pc_q35_init(MachineState *machine) } else if (xen_enabled()) { i8259 = xen_interrupt_controller_init(); } else { - cpu_irq = pc_allocate_cpu_irq(); - i8259 = i8259_init(isa_bus, cpu_irq[0]); + i8259 = i8259_init(isa_bus, pc_allocate_cpu_irq()); } for (i = 0; i < ISA_NUM_IRQS; i++) { diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 27bd748..261155f 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -193,7 +193,7 @@ FWCfgState *pc_memory_init(MachineState *machine, MemoryRegion *rom_memory, MemoryRegion **ram_memory, PcGuestInfo *guest_info); -qemu_irq *pc_allocate_cpu_irq(void); +qemu_irq pc_allocate_cpu_irq(void); DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus); void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, ISADevice **rtc_state,