mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Byungchul Park <byungchul.park@lge.com>
To: peterz@infradead.org, mingo@kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@lge.com, ying.huang@intel.com
Subject: [PATCH] llist: Put parentheses around parameters of llist_for_each_entry_safe()
Date: Tue, 26 Sep 2017 15:54:51 +0900	[thread overview]
Message-ID: <1506408891-27460-1-git-send-email-byungchul.park@lge.com> (raw)

It would be somewhat safer to put parentheses around parameters of
a macro with parameters. Put it.

Signed-off-by: Byungchul Park <byungchul.park@lge.com>
---
 include/linux/llist.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/llist.h b/include/linux/llist.h
index 1957635..e280b297 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -183,10 +183,10 @@ static inline void init_llist_head(struct llist_head *list)
  * reverse the order by yourself before traversing.
  */
 #define llist_for_each_entry_safe(pos, n, node, member)			       \
-	for (pos = llist_entry((node), typeof(*pos), member);		       \
+	for ((pos) = llist_entry((node), typeof(*(pos)), member);		       \
 	     member_address_is_nonnull(pos, member) &&			       \
-	        (n = llist_entry(pos->member.next, typeof(*n), member), true); \
-	     pos = n)
+	        ((n) = llist_entry((pos)->member.next, typeof(*(n)), member), true); \
+	     (pos) = (n))
 
 /**
  * llist_empty - tests whether a lock-less list is empty
-- 
1.9.1

             reply	other threads:[~2017-09-26  6:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26  6:54 Byungchul Park [this message]
2017-09-26  7:01 ` Huang, Ying
2017-09-26  8:01   ` 박병철/선임연구원/SW Platform(연)AOT팀(byungchul.park@lge.com)
2017-09-26  8:14     ` Huang, Ying
2017-09-26  8:36       ` 박병철/선임연구원/SW Platform(연)AOT팀(byungchul.park@lge.com)
2017-11-17  2:31 ` Byungchul Park

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=1506408891-27460-1-git-send-email-byungchul.park@lge.com \
    --to=byungchul.park@lge.com \
    --cc=kernel-team@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=ying.huang@intel.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

all inboxes | Powered by JetHome®