From patchwork Thu Oct 19 12:48:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 10016647 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56E52603FF for ; Thu, 19 Oct 2017 12:51:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38B4128D26 for ; Thu, 19 Oct 2017 12:51:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2DD3B28D42; Thu, 19 Oct 2017 12:51:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD33028D3F for ; Thu, 19 Oct 2017 12:51:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5AG3-0004QT-QX; Thu, 19 Oct 2017 12:49:07 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5AG3-0004Q7-0b for xen-devel@lists.xenproject.org; Thu, 19 Oct 2017 12:49:07 +0000 Received: from [85.158.139.211] by server-13.bemta-5.messagelabs.com id 26/1C-10419-24F98E95; Thu, 19 Oct 2017 12:49:06 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRWlGSWpSXmKPExsVysyfVTddx/ot Igx8PdCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1ozt356xFrzjqth78SR7A+Nczi5GLg4hgQ2M EqverWKCcJYzSly6P4u1i5GTg01AV2LHzdfMILaIQITE6ceXmEBsZgElif1nrzGC2MIC5hKzT xwGq2cRUJX4/OkDmM0rYCVxfP1udhBbQkBe4tyD22BzOAWsJW7vvQHWKwRUs+3hO8YJjNwLGB lWMaoXpxaVpRbpGuolFWWmZ5TkJmbm6BoamOrlphYXJ6an5iQmFesl5+duYgT6t56BgXEHY1O v8yFGSQ4mJVHej1UvIoX4kvJTKjMSizPii0pzUosPMcpwcChJ8G6aB5QTLEpNT61Iy8wBBhpM WoKDR0mEN3ouUJq3uCAxtzgzHSJ1ilGXo+Pm3T9MQix5+XmpUuK8MSAzBECKMkrz4EbAgv4So 6yUMC8jAwODEE9BalFuZgmq/CtGcQ5GJWHeOJApPJl5JXCbXgEdwQR0BLs92BEliQgpqQZGro 4Jqg1TvLm177Q+UfazvV7/bdasbIXfVtNbX91/Ms9dvrWE+8rmJ4dMdJbYLnLi1xGuqDex09s el9rlvP/nF3ne52d4S+RqYiY1WHxf9Fs74l25lu0qC63XcxYnaRxsV3a5kBL9x1Wifd6BFu7Z h/6f2N93aPqfXZ7RH9v+smb43U3JM52rxFKckWioxVxUnAgAnNuItXUCAAA= X-Env-Sender: andre.przywara@arm.com X-Msg-Ref: server-7.tower-206.messagelabs.com!1508417345!104833339!1 X-Originating-IP: [217.140.101.70] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 57654 invoked from network); 19 Oct 2017 12:49:05 -0000 Received: from usa-sjc-mx-foss1.foss.arm.com (HELO foss.arm.com) (217.140.101.70) by server-7.tower-206.messagelabs.com with SMTP; 19 Oct 2017 12:49:05 -0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C303CF; Thu, 19 Oct 2017 05:49:04 -0700 (PDT) Received: from e104803-lin.lan (unknown [10.1.207.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D77163F3E1; Thu, 19 Oct 2017 05:49:03 -0700 (PDT) From: Andre Przywara To: Julien Grall , Stefano Stabellini Date: Thu, 19 Oct 2017 13:48:37 +0100 Message-Id: <20171019124847.5978-3-andre.przywara@arm.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171019124847.5978-1-andre.przywara@arm.com> References: <20171019124847.5978-1-andre.przywara@arm.com> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH 02/12] ARM: vGIC: fix nr_irq definition X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The global variable "nr_irqs" is used for x86 and some common Xen code. To make the latter work easily for ARM, it was #defined to NR_IRQS. This not only violated the common habit of capitalizing macros, but also caused issues if one wanted to use a rather innocent "nr_irqs" as a local variable name or as a function parameter. Drop the optimization and make nr_irqs a normal variable for ARM also. Signed-off-by: Andre Przywara Reviewed-by: Stefano Stabellini --- xen/arch/arm/irq.c | 2 ++ xen/include/asm-arm/irq.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c index cbc7e6ebb8..7f133de549 100644 --- a/xen/arch/arm/irq.c +++ b/xen/arch/arm/irq.c @@ -27,6 +27,8 @@ #include #include +unsigned int __read_mostly nr_irqs = NR_IRQS; + static unsigned int local_irqs_type[NR_LOCAL_IRQS]; static DEFINE_SPINLOCK(local_irqs_type_lock); diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h index 2de76d0f56..abc8f06a13 100644 --- a/xen/include/asm-arm/irq.h +++ b/xen/include/asm-arm/irq.h @@ -31,7 +31,7 @@ struct arch_irq_desc { /* LPIs are always numbered starting at 8192, so 0 is a good invalid case. */ #define INVALID_LPI 0 -#define nr_irqs NR_IRQS +extern unsigned int nr_irqs; #define nr_static_irqs NR_IRQS #define arch_hwdom_irqs(domid) NR_IRQS