From: Jan Beulich <jbeulich@suse.com>
To: Nicola Vetrini <nicola.vetrini@bugseng.com>
Cc: sstabellini@kernel.org, michal.orzel@amd.com,
xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com,
consulting@bugseng.com, bertrand.marquis@arm.com, julien@xen.org,
Andrew Cooper <andrew.cooper3@citrix.com>,
George Dunlap <george.dunlap@citrix.com>, Wei Liu <wl@xen.org>,
xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH v2 3/7] xen/list: address violations of MISRA C Rule 20.7
Date: Mon, 11 Mar 2024 08:48:55 +0100 [thread overview]
Message-ID: <0d3af110-773e-40bd-bd95-b385f49a7c47@suse.com> (raw)
In-Reply-To: <b93a64b93ef4210f5fe96368c2522e5e71e9c87c.1709896401.git.nicola.vetrini@bugseng.com>
On 08.03.2024 12:21, Nicola Vetrini wrote:
> --- a/xen/include/xen/list.h
> +++ b/xen/include/xen/list.h
> @@ -479,9 +479,9 @@ static inline void list_splice_init(struct list_head *list,
> * @n: another &struct list_head to use as temporary storage
> * @head: the head for your list.
> */
> -#define list_for_each_backwards_safe(pos, n, head) \
> - for ( pos = (head)->prev, n = pos->prev; pos != (head); \
> - pos = n, n = pos->prev )
> +#define list_for_each_backwards_safe(pos, n, head) \
> + for ( (pos) = (head)->prev, n = (pos)->prev; (pos) != (head); \
> + (pos) = n, n = (pos)->prev )
I think this is worse than before and incomplete: At least the rhs use of n
also needs parenthesizing. Plus if pos is parenthesized even in lhs
instances, imo n ought to be, too.
Jan
next prev parent reply other threads:[~2024-03-11 7:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 11:20 [XEN PATCH v2 0/7] address some violations of MISRA C Rule 20.7 Nicola Vetrini
2024-03-08 11:20 ` [XEN PATCH v2 1/7] xen/spinlock: address " Nicola Vetrini
2024-03-09 1:23 ` Stefano Stabellini
2024-03-08 11:20 ` [XEN PATCH v2 2/7] xen/include: " Nicola Vetrini
2024-03-09 1:26 ` Stefano Stabellini
2024-03-08 11:21 ` [XEN PATCH v2 3/7] xen/list: " Nicola Vetrini
2024-03-09 1:29 ` Stefano Stabellini
2024-03-11 7:48 ` Jan Beulich [this message]
2024-03-11 8:19 ` Nicola Vetrini
2024-03-08 11:21 ` [XEN PATCH v2 4/7] xen/param: " Nicola Vetrini
2024-03-09 1:32 ` Stefano Stabellini
2024-03-08 11:21 ` [XEN PATCH v2 5/7] xen/arm: address some " Nicola Vetrini
2024-03-09 1:53 ` Stefano Stabellini
2024-03-08 11:21 ` [XEN PATCH v2 6/7] x86/irq: parenthesize negative constants Nicola Vetrini
2024-03-09 1:54 ` Stefano Stabellini
2024-03-11 7:50 ` Jan Beulich
2024-03-08 11:21 ` [XEN PATCH v2 7/7] arm/smmu: address some violations of MISRA C Rule 20.7 Nicola Vetrini
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=0d3af110-773e-40bd-bd95-b385f49a7c47@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ayan.kumar.halder@amd.com \
--cc=bertrand.marquis@arm.com \
--cc=consulting@bugseng.com \
--cc=george.dunlap@citrix.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=nicola.vetrini@bugseng.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
--cc=xenia.ragiadakou@amd.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).