From patchwork Wed May 11 13:30:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 9070021 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8464F9F6FA for ; Wed, 11 May 2016 13:32:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FCB0200ED for ; Wed, 11 May 2016 13:32:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B6522012D for ; Wed, 11 May 2016 13:32:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932598AbcEKNc4 (ORCPT ); Wed, 11 May 2016 09:32:56 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:35302 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932560AbcEKNcM (ORCPT ); Wed, 11 May 2016 09:32:12 -0400 Received: by mail-wm0-f54.google.com with SMTP id e201so219201042wme.0 for ; Wed, 11 May 2016 06:32:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jk579frS1xvvL91pThxDwGOHrh43nadAA7mVn8nY3cY=; b=fvOxF3m1923YZLKio96Jr6gHrBt+5LEdE+TrU1g7v3VYEzlv5tKxBe16sg70kEeLDj 16Cb8hN9ElZXbXFeGv59lCKPZUlYMtFLYnM/J4k6ESZBhevW/afmhTNi9Dzh7kd5GxyM HTUzX+4epeADc2ZhUCQ04rujMaNcw+sd4tDmI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jk579frS1xvvL91pThxDwGOHrh43nadAA7mVn8nY3cY=; b=ZO6ovIdMgPFXd7YXhuChS+kbO3VfBlGUJ5jRH1j3LQ6mf9K3XsZzWZlMA2huGR1JLt B5TTl+RyzLpxtvkFujC/xDA9pwZQhue496cAwRIfcyftDTL1atElEpAVlLnP7QVpTOXW QJtDDTD5s038o67OyjwcYvj48kiKFjSTUsjwYqtyYVxubws/QH2nz/pWS5J2FqY3TJND upBAlQfipcF82mcMA46NB40dbEBLTL2hNOkgwqolPv7Y9qaIur9iavEUbxiv/mHFZV6T 0rL+SCgErHtx2a/MRc9KGef4TXaanmPiUt3yTcTIgSPKCRPV+FCmsj+ILkqE4koH+YZC p5GA== X-Gm-Message-State: AOPr4FV8PiffoXthOmrkJtOTu96KXDbC8e7Wa+IaV27JAHuwNt3z1vvGECSIGC2vwARvzzsi X-Received: by 10.194.57.168 with SMTP id j8mr3816871wjq.43.1462973531034; Wed, 11 May 2016 06:32:11 -0700 (PDT) Received: from localhost.localdomain ([94.18.191.146]) by smtp.gmail.com with ESMTPSA id 131sm8547278wmu.17.2016.05.11.06.32.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 May 2016 06:32:10 -0700 (PDT) From: Christoffer Dall To: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Cc: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Marc Zyngier , Julien Grall , Christoffer Dall Subject: [PULL 21/29] irqchip/gic-v2: Gather ACPI specific data in a single structure Date: Wed, 11 May 2016 15:30:14 +0200 Message-Id: <1462973422-10021-22-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1462973422-10021-1-git-send-email-christoffer.dall@linaro.org> References: <1462973422-10021-1-git-send-email-christoffer.dall@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Julien Grall The ACPI code requires to use global variables in order to collect information from the tables. For now, a single global variable is used, but more will be added in a subsequent patch. To make clear they are ACPI specific, gather all the information in a single structure. Signed-off-by: Julien Grall Acked-by: Christofer Dall Acked-by: Hanjun Guo Signed-off-by: Christoffer Dall --- drivers/irqchip/irq-gic.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index 282344b..7a73786 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1245,7 +1245,10 @@ IRQCHIP_DECLARE(pl390, "arm,pl390", gic_of_init); #endif #ifdef CONFIG_ACPI -static phys_addr_t cpu_phy_base __initdata; +static struct +{ + phys_addr_t cpu_phys_base; +} acpi_data __initdata; static int __init gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, @@ -1265,10 +1268,10 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, * All CPU interface addresses have to be the same. */ gic_cpu_base = processor->base_address; - if (cpu_base_assigned && gic_cpu_base != cpu_phy_base) + if (cpu_base_assigned && gic_cpu_base != acpi_data.cpu_phys_base) return -EINVAL; - cpu_phy_base = gic_cpu_base; + acpi_data.cpu_phys_base = gic_cpu_base; cpu_base_assigned = 1; return 0; } @@ -1316,7 +1319,7 @@ static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, return -EINVAL; } - cpu_base = ioremap(cpu_phy_base, ACPI_GIC_CPU_IF_MEM_SIZE); + cpu_base = ioremap(acpi_data.cpu_phys_base, ACPI_GIC_CPU_IF_MEM_SIZE); if (!cpu_base) { pr_err("Unable to map GICC registers\n"); return -ENOMEM;