public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] llist: Put parentheses around parameters of llist_for_each_entry_safe()
@ 2017-09-26  6:54 Byungchul Park
  2017-09-26  7:01 ` Huang, Ying
  2017-11-17  2:31 ` Byungchul Park
  0 siblings, 2 replies; 6+ messages in thread
From: Byungchul Park @ 2017-09-26  6:54 UTC (permalink / raw)
  To: peterz, mingo; +Cc: linux-kernel, kernel-team, ying.huang

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-17  2:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-26  6:54 [PATCH] llist: Put parentheses around parameters of llist_for_each_entry_safe() Byungchul Park
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox