From: Igor Stoppa <igor.stoppa@huawei.com>
To: <trivial@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Guenter Roeck <linux@roeck-us.net>,
Javi Merino <javi.merino@arm.com>,
Igor Stoppa <igor.stoppa@huawei.com>
Subject: [PATCH 1/1] Add paretheses to macro parameters. For trivial
Date: Wed, 22 Nov 2017 15:11:53 +0200 [thread overview]
Message-ID: <20171122131153.16332-2-igor.stoppa@huawei.com> (raw)
In-Reply-To: <20171122131153.16332-1-igor.stoppa@huawei.com>
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
prev parent reply other threads:[~2017-11-22 13:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 13:11 [PATCH 0/1] Trivial: Add parentheses to parameters in macros Igor Stoppa
2017-11-22 13:11 ` Igor Stoppa [this message]
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=20171122131153.16332-2-igor.stoppa@huawei.com \
--to=igor.stoppa@huawei.com \
--cc=javi.merino@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=trivial@kernel.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 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®