All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Trivial: Add parentheses to parameters in macros
@ 2017-11-22 13:11 Igor Stoppa
  2017-11-22 13:11 ` [PATCH 1/1] Add paretheses to macro parameters. For trivial Igor Stoppa
  0 siblings, 1 reply; 2+ messages in thread
From: Igor Stoppa @ 2017-11-22 13:11 UTC (permalink / raw)
  To: trivial
  Cc: linux-kernel, Tetsuo Handa, Guenter Roeck, Javi Merino, Igor Stoppa

Some parameters are used in macros without being surrounded by parentheses.

Igor Stoppa (1):
  Add paretheses to macro parameters. For trivial

 include/linux/kernel.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.9.3

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

* [PATCH 1/1] Add paretheses to macro parameters. For trivial
  2017-11-22 13:11 [PATCH 0/1] Trivial: Add parentheses to parameters in macros Igor Stoppa
@ 2017-11-22 13:11 ` Igor Stoppa
  0 siblings, 0 replies; 2+ messages in thread
From: Igor Stoppa @ 2017-11-22 13:11 UTC (permalink / raw)
  To: trivial
  Cc: linux-kernel, Tetsuo Handa, Guenter Roeck, Javi Merino, Igor Stoppa

kernel.h: Some macros are not wrapping their parameters with parentheses.

Signed-off-by: Igor Stoppa <igor.stoppa@huawei.com>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Javi Merino <javi.merino@arm.com>
---
 include/linux/kernel.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 4b484ab..4061f46 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -112,7 +112,7 @@
 /* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
 #define roundup(x, y) (					\
 {							\
-	const typeof(y) __y = y;			\
+	const typeof(y) __y = (y);			\
 	(((x) + (__y - 1)) / __y) * __y;		\
 }							\
 )
@@ -131,8 +131,8 @@
  */
 #define DIV_ROUND_CLOSEST(x, divisor)(			\
 {							\
-	typeof(x) __x = x;				\
-	typeof(divisor) __d = divisor;			\
+	typeof(x) __x = (x);				\
+	typeof(divisor) __d = (divisor);		\
 	(((typeof(x))-1) > 0 ||				\
 	 ((typeof(divisor))-1) > 0 ||			\
 	 (((__x) > 0) == ((__d) > 0))) ?		\
@@ -146,7 +146,7 @@
  */
 #define DIV_ROUND_CLOSEST_ULL(x, divisor)(		\
 {							\
-	typeof(divisor) __d = divisor;			\
+	typeof(divisor) __d = (divisor);		\
 	unsigned long long _tmp = (x) + (__d) / 2;	\
 	do_div(_tmp, __d);				\
 	_tmp;						\
-- 
2.9.3

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

end of thread, other threads:[~2017-11-22 13:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 13:11 [PATCH 0/1] Trivial: Add parentheses to parameters in macros Igor Stoppa
2017-11-22 13:11 ` [PATCH 1/1] Add paretheses to macro parameters. For trivial Igor Stoppa

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.