All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Xenia Ragiadakou <burzalodowa@gmail.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen/arm64: sysreg.h: Fix MISRA C 2012 Rule 20.7 violation
Date: Thu, 28 Jul 2022 16:20:45 +0200	[thread overview]
Message-ID: <83c17bf6-b9b2-a297-6f7f-dd08231d0f90@suse.com> (raw)
In-Reply-To: <0a8ff178-280d-717f-dacb-4eb9f57a24eb@xen.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


  reply	other threads:[~2022-07-28 14:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28 13:49 [PATCH] xen/arm64: sysreg.h: Fix MISRA C 2012 Rule 20.7 violation Xenia Ragiadakou
2022-07-28 13:56 ` Julien Grall
2022-07-28 14:20   ` Jan Beulich [this message]
2022-07-28 14:34     ` Julien Grall
2022-07-28 15:29       ` Xenia Ragiadakou
2022-07-28 22:56       ` Stefano Stabellini
2022-07-29  5:23         ` Xenia Ragiadakou
2022-07-29  6:16           ` Jan Beulich
2022-07-29  7:01             ` Xenia Ragiadakou
2022-07-29  7:22               ` Jan Beulich
2022-07-29  7:58                 ` Xenia Ragiadakou
2022-07-29  9:34                 ` Xenia Ragiadakou
2022-08-02 17:32                 ` Julien Grall
2022-08-03  6:10                   ` Jan Beulich
2022-07-28 15:15   ` Xenia Ragiadakou
2022-07-28 15:37     ` Julien Grall
2022-07-28 14:17 ` Jan Beulich
2022-07-28 14:45   ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83c17bf6-b9b2-a297-6f7f-dd08231d0f90@suse.com \
    --to=jbeulich@suse.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=burzalodowa@gmail.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.