From patchwork Thu Dec 7 16:14:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 121021 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp8556417qgn; Thu, 7 Dec 2017 08:16:45 -0800 (PST) X-Google-Smtp-Source: AGs4zMaSKE/gctrv5Z71vniwRQMe+h2+AkcxRUNDqqA1PhPhOE0TcSnDYKYGW9wprj1B64T1geJC X-Received: by 10.36.77.143 with SMTP id l137mr2129851itb.50.1512663405668; Thu, 07 Dec 2017 08:16:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512663405; cv=none; d=google.com; s=arc-20160816; b=KCap18yiC59yqEJShUkaPr3yU4ILSbz6eC7v2Zd2GpzHx7iIQE716xMOmJjUi+35q4 6lFvfy39prCw8y1daWyRIotIJYjipb4wUDhQ7VQ/13tjx8HwnylM1eeIvK9e8jx6mNom DyzkNwTaDadgH6G86sNL6sxkhSyD2s0AuNSGRgVG8YYp/74e8OePuidRX6dqmp8tGNR1 ubea/77H+ORoH5DeUy9h7m89Sd0p1K4Ugywtlt8HdXptD6xmsCxD+YdvDo8OMzPU5TpN rs1myKWdLH5F6rI6PJa0SS/v3nnZ8p3h3TKUdIQgu7aD8yCXFGcztkgj7+3jFHTb2ugi E1RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:references:in-reply-to:message-id:date:to :from:dkim-signature:arc-authentication-results; bh=/eQRQZ1NqPgEej30PJMy6l46nIwopZ26kW0Dreye8Rg=; b=ldxU18esPKstQ6hVS2FSh2vsB6aSuglZgjozW+FyKOT40Su6vswVoT2Zy3Vgx0Qiqd ERWqn/9bhbYwoSwf2bHcy1MHQb+TjzJWJCZCqriO3ok1C/IUd+y762xfa0SLTftlfIQE pNVSiKLIjHg2v2e/N5nu46h20tW8sgnTMPCTB16JtE1WEXb/r7a3qLoSY3reC7PTEDKr IwE0v6DCsla2qigNFfkGIA4n2RbV9UnToG1fcEwYaJVvILIodw8SCIb1s2I88hvtMZoX PXEvUhZ4Z70gKoSpK7qN9PQIafNmHiFx4ZuXs46b5lwQikaWYxtBoxeJn+Q4ZSIPmBe2 bcZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=emoBooRc; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id q15si2195165ioh.2.2017.12.07.08.16.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2017 08:16:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=emoBooRc; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMyoV-0002AJ-DA; Thu, 07 Dec 2017 16:14:19 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMyoU-00029m-DF for xen-devel@lists.xenproject.org; Thu, 07 Dec 2017 16:14:18 +0000 X-Inumbo-ID: 9e2b219d-db69-11e7-b4a6-bc764e045a96 Received: from mail-wr0-x241.google.com (unknown [2a00:1450:400c:c0c::241]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTPS id 9e2b219d-db69-11e7-b4a6-bc764e045a96; Thu, 07 Dec 2017 17:13:53 +0100 (CET) Received: by mail-wr0-x241.google.com with SMTP id k61so8047930wrc.4 for ; Thu, 07 Dec 2017 08:14:17 -0800 (PST) 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=ECFNq1x+wNolShDEl+fe4ys+M3lpJlIaU4VRZbDMZ04=; b=emoBooRcEfV2VdhDmW8qLlyWyP0NN9oI7Bx6wDm0PU4PYqWIsiBJkRT6iwOo19G6yy JGnT5rslsCeDZR6fOygTuiitpCImGN194psc+TJYRi3niwNcNAbGafjK++bjRd+s1SFa cnxsCihBtiJ5dtByHcTuLJpQTDAkbj3N++1fg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ECFNq1x+wNolShDEl+fe4ys+M3lpJlIaU4VRZbDMZ04=; b=Q49xJ0+CVY1UdezgixKb8+DKe0LEmNOPEFVtRJJmWMyvQt8Ae+R2GDK3rMcgfjsmn2 khzOoQOHI0n9aEQDa6M33lpCPhxv1kV2+ToY+9DchQX+aWvSPAMTg0OtLIsCL7ThYwop e3zzmo7+zc4D3JYUMJVjEev2kf0dukPZMtLjfC72MZAkrelFSdFhu0WLkMX3x3vJrv0O 20ZaJeE31U5ZZC0tMfoTJzz1vSL0ogoYHw0iHtjVkCZqd5mxExVluTJYR7uYnz3F3j19 pdVmkrMoiHt/gZeNMEDE+TwRm8YQz3opeyY4y0AjAKrptJcme5frvlSuls+Qgp4+7gjO AUWg== X-Gm-Message-State: AJaThX4lp7/xDzx9TJ4po/nnhB3ggS494jDp47K1Yb/+6ACODqWEQXMK SAl7E4pff/MhN71Jhp5NF7A7kw== X-Received: by 10.223.184.197 with SMTP id c5mr22589451wrg.18.1512663256035; Thu, 07 Dec 2017 08:14:16 -0800 (PST) Received: from e104803-lin.lan (mail.andrep.de. [217.160.17.100]) by smtp.gmail.com with ESMTPSA id f18sm6090624wrg.66.2017.12.07.08.14.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Dec 2017 08:14:15 -0800 (PST) From: Andre Przywara To: Stefano Stabellini , Julien Grall Date: Thu, 7 Dec 2017 16:14:07 +0000 Message-Id: <20171207161415.20380-3-andre.przywara@linaro.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171207161415.20380-1-andre.przywara@linaro.org> References: <20171207161415.20380-1-andre.przywara@linaro.org> Cc: xen-devel@lists.xenproject.org Subject: [Xen-devel] [PATCH v2 02/10] ARM: vGIC: fix nr_irq definition X-BeenThere: xen-devel@lists.xenproject.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.xenproject.org Sender: "Xen-devel" 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