From mboxrd@z Thu Jan 1 00:00:00 1970 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 4A08AC04A68 for ; Thu, 28 Jul 2022 13:57:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.376819.609839 (Exim 4.92) (envelope-from ) id 1oH40V-0007Hs-LG; Thu, 28 Jul 2022 13:56:55 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 376819.609839; Thu, 28 Jul 2022 13:56:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oH40V-0007Hl-IE; Thu, 28 Jul 2022 13:56:55 +0000 Received: by outflank-mailman (input) for mailman id 376819; Thu, 28 Jul 2022 13:56:54 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oH40U-0007HX-Fn for xen-devel@lists.xenproject.org; Thu, 28 Jul 2022 13:56:54 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oH40T-0001m3-AZ; Thu, 28 Jul 2022 13:56:53 +0000 Received: from 54-240-197-224.amazon.com ([54.240.197.224] helo=[10.7.237.22]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oH40T-0006cu-4J; Thu, 28 Jul 2022 13:56:53 +0000 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" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=BEJ0o307PAotTTzZF4En/zIAWbhlASmp+bfSYacuPQk=; b=p4K5XJCHFstmzOtTibN7ejYnFU STr5Mp33DUJmATsyMhQG1EkxWxrKUz8EaYIQ0lofhAMaSXEcsvJ1I9F+Aunrp6G1Ri29Urq/d8Ik0 POuUUVE+6wWR7mXbu62lny55AO+BDlRyF00TNAlcD2CTodz9iPyhQYLTRodImSs/TzG0=; Message-ID: <0a8ff178-280d-717f-dacb-4eb9f57a24eb@xen.org> Date: Thu, 28 Jul 2022 14:56:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.0.3 Subject: Re: [PATCH] xen/arm64: sysreg.h: Fix MISRA C 2012 Rule 20.7 violation Content-Language: en-US To: Xenia Ragiadakou , xen-devel@lists.xenproject.org Cc: Stefano Stabellini , Bertrand Marquis , Volodymyr Babchuk References: <20220728134943.1185621-1-burzalodowa@gmail.com> From: Julien Grall In-Reply-To: <20220728134943.1185621-1-burzalodowa@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, On 28/07/2022 14:49, Xenia Ragiadakou wrote: > The macro parameter 'v' is used as an expression and needs to be enclosed in > parentheses. > > Signed-off-by: Xenia Ragiadakou > --- > xen/arch/arm/include/asm/arm64/sysregs.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/arch/arm/include/asm/arm64/sysregs.h b/xen/arch/arm/include/asm/arm64/sysregs.h > index 54670084c3..f5a7269a27 100644 > --- a/xen/arch/arm/include/asm/arm64/sysregs.h > +++ b/xen/arch/arm/include/asm/arm64/sysregs.h > @@ -461,7 +461,7 @@ > /* Access to system registers */ > > #define WRITE_SYSREG64(v, name) do { \ > - uint64_t _r = v; \ > + uint64_t _r = (v); \ I am failing to see why the parentheses are necessary here. Could you give an example where the lack of them would end up to different code? > asm volatile("msr "__stringify(name)", %0" : : "r" (_r)); \ > } while (0) > #define READ_SYSREG64(name) ({ \ Cheers, -- Julien Grall