From patchwork Fri Aug 19 19:43:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xenia Ragiadakou X-Patchwork-Id: 12949161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8703BC32796 for ; Fri, 19 Aug 2022 19:44:46 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.390440.627905 (Exim 4.92) (envelope-from ) id 1oP7uy-0005lk-TA; Fri, 19 Aug 2022 19:44:32 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 390440.627905; Fri, 19 Aug 2022 19:44:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oP7uy-0005l7-Ob; Fri, 19 Aug 2022 19:44:32 +0000 Received: by outflank-mailman (input) for mailman id 390440; Fri, 19 Aug 2022 19:44:31 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oP7ux-0004jK-On for xen-devel@lists.xenproject.org; Fri, 19 Aug 2022 19:44:31 +0000 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [2a00:1450:4864:20::62d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 57dfb0a4-1ff7-11ed-bd2e-47488cf2e6aa; Fri, 19 Aug 2022 21:44:31 +0200 (CEST) Received: by mail-ej1-x62d.google.com with SMTP id j8so10624301ejx.9 for ; Fri, 19 Aug 2022 12:44:31 -0700 (PDT) Received: from uni.. (adsl-47.176.58.181.tellas.gr. [176.58.181.47]) by smtp.googlemail.com with ESMTPSA id r17-20020a1709061bb100b00731745a7e62sm2695059ejg.28.2022.08.19.12.44.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 12:44:30 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 57dfb0a4-1ff7-11ed-bd2e-47488cf2e6aa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=xsltoJ+dF+zfeCEbbMIuZE8kHB12dqzZs8TVxgAefJ4=; b=hkGJIU1aGvYGm0v+Am6NTz5xNmDSGroHAYI6UuB20/aEDzeVw737lQzzrQ3d7nJb/g Vn77nJESXhO9IpFsIxIn30XMhSFav7IF9W4iy+hzE1r+5F08Hd9r6opWTPHLVqZgkw0S CP0Yn6X5qrcAcs0O92cXhXitbJ9IwPyd/2ROX+hGPKdsPNjsc/JWiKSjFaftrqWU5pQB rLWyfEh/Yaly//Pw1tOQLsWmD3gQUPf4mTWNxgURjRKSd6NYFMrHEiZl9RBLD+zulsai FZU7cxhwEzWYhMKt9n1HDL76cGBh6SWD6WwUEN0DXTeNS9aYHtyhgJ/aFHyU2l6Qih+n W6pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=xsltoJ+dF+zfeCEbbMIuZE8kHB12dqzZs8TVxgAefJ4=; b=ZE7nMcODzewHL1bpwcKjLJoOfPuts6mS2zXC3sVa4VLawhtZaqY8zpGSSLTwH1kl9v sVH7yDkZNDl6KiXEPuFWBPzHaofFUdaK+XEDbrp3vFHeGQD/0WuKY95Zin5JJA2Ll/i9 rn9D0H4G1CAJ5+Nu5tZR4BMmypZMTF1ZvNV/BhaK7gavfEmpBSzTkck0HymJP0fhkUjr d2tB5yIQcdnXNw2wj9MYitXnnCSZmhee4v//EPTCEnfzjsIVIa9KX47PwZMOptpU0i7a 2O0j2c7qJcYl45EAz3FpyvTNjJsB9YM2jerjmWydNDyXx62Hmb9v48C9TZCXXMi3gefJ OAZQ== X-Gm-Message-State: ACgBeo3iA/wK2Olf/8xIzmFl1fe4IH95yaYTo9fB0W7+zFGtZadU2RX1 NMQEng4Wdwd/KsKgMm7soczRIdn88go= X-Google-Smtp-Source: AA6agR5kNgSC8WIOR/guTy01VB6ZBeKd18XpapZrxSp3zFJUChmBFUeJdYroXwEyJhgbetNcj0wBgw== X-Received: by 2002:a17:907:7ea8:b0:731:4fa1:d034 with SMTP id qb40-20020a1709077ea800b007314fa1d034mr5815250ejc.758.1660938270375; Fri, 19 Aug 2022 12:44:30 -0700 (PDT) From: Xenia Ragiadakou To: xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk Subject: [PATCH 4/7] xen/vgic: Fix MISRA C 2012 Rule 20.7 violation Date: Fri, 19 Aug 2022 22:43:56 +0300 Message-Id: <20220819194359.1196539-5-burzalodowa@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220819194359.1196539-1-burzalodowa@gmail.com> References: <20220819194359.1196539-1-burzalodowa@gmail.com> MIME-Version: 1.0 In macro VGIC_V3_LR_INDEX(), add parentheses around the macro parameter to prevent against unintended expansions. Signed-off-by: Xenia Ragiadakou Reviewed-by: Stefano Stabellini --- xen/arch/arm/include/asm/new_vgic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/include/asm/new_vgic.h b/xen/arch/arm/include/asm/new_vgic.h index ab57fcd91d..b7fa9ab11a 100644 --- a/xen/arch/arm/include/asm/new_vgic.h +++ b/xen/arch/arm/include/asm/new_vgic.h @@ -43,7 +43,7 @@ enum vgic_type { #define VGIC_V2_MAX_LRS (1 << 6) #define VGIC_V3_MAX_LRS 16 -#define VGIC_V3_LR_INDEX(lr) (VGIC_V3_MAX_LRS - 1 - lr) +#define VGIC_V3_LR_INDEX(lr) (VGIC_V3_MAX_LRS - 1 - (lr)) #define VGIC_CONFIG_EDGE false #define VGIC_CONFIG_LEVEL true