[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm64: sysreg.h: Fix MISRA C 2012 Rule 20.7 violation
- To: Julien Grall <julien@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 28 Jul 2022 16:20:45 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YEEYTecIwfQViuafC873OhjTtNQD5vxg6NG9mUvXe6A=; b=e3bpDxYsZw6m7Zmx/xW2CVv6PE9dQ8WdUZu07/InPvccG0fdUBNPI1Zu09cpJ8LHZtkP7smOcrrK0/1GNYckQfs3t91q1uGX1zCt1fBGLQNeAroxZK9wPmwKWn/bVhMWdhkNXphzYCGHkiaZhdzWogQwR5jVvlC7LFd1w5tbg1aMV0bdfdjc5/UI+iAl+WfBA+Gtu4hMsWaAQIHIIDwc3osEt1sq7iMgyTYs2u/vadhFuhTHSOUtmsXQ9YHKlJFqsDFGSJ1Su8zRh2mV9HYcHVuL42RpUEfC3rUwHr0XE614ukH9V1+K2vYgmmitzrEJhYF+STVMQZA6HXEXpjQEUg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ndCS1omBHznKx88iPoWAUn3BthfzfRtCojrUKTjB/sz6suhq5iGrkBWHKwsw8H1MNgIzpkSYNX5PjguDbbEA1pS0yKvxVT3p1ikzEuOBYyBvS+BPSIimqYsyljUeyDVhwkJHGC87BXkm/n/p7vqE+NyUr8caINAOyGX05Z+K2gjEEUQmmzkPFFbxcbFCGMZRD+lf5pUmz3Ed6Pap+v06kCIYIV9HaDPpl1d2nbS74b/q++wsi/KQkm4jZ4aJEucoNAhpb1B3gsqGzO8LIq1fFDWzhvt20gkfvL3mTBY7bX5KKroFD4MPEWO/pEPmRGeh233WrLDwzgxUQL0NjnxWeg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Xenia Ragiadakou <burzalodowa@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 28 Jul 2022 14:20:54 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 28.07.2022 15:56, Julien Grall wrote:
> On 28/07/2022 14:49, Xenia Ragiadakou wrote:
>> --- 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?
I think it is merely good practice to parenthesize the right sides of =.
Indeed with assignment operators having second to lowest precedence, and
with comma (the lowest precedence one) requiring parenthesization at the
macro invocation site, there should be no real need for parentheses here.
Jan
|