From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: akpm@linux-foundation.org
Cc: Mark Rustad <mark.d.rustad@intel.com>,
linux-kernel@vger.kernel.org,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [PATCH] kernel: Resolve a shadow warning
Date: Thu, 4 Sep 2014 06:18:57 -0700 [thread overview]
Message-ID: <1409836737-29469-1-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
From: Mark Rustad <mark.d.rustad@intel.com>
Resolve a shadow warning in W=2 builds arising from min/max macro
references in a parameter to a min3/max3 macro. There is no
functional issue - the warning is benign - but simply changing
some local variable names will eliminate it.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
include/linux/kernel.h | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 95624be..c653902 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -716,22 +716,22 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
_max1 > _max2 ? _max1 : _max2; })
#define min3(x, y, z) ({ \
- typeof(x) _min1 = (x); \
- typeof(y) _min2 = (y); \
- typeof(z) _min3 = (z); \
- (void) (&_min1 == &_min2); \
- (void) (&_min1 == &_min3); \
- _min1 < _min2 ? (_min1 < _min3 ? _min1 : _min3) : \
- (_min2 < _min3 ? _min2 : _min3); })
+ typeof(x) _min31 = (x); \
+ typeof(y) _min32 = (y); \
+ typeof(z) _min33 = (z); \
+ (void) (&_min31 == &_min32); \
+ (void) (&_min31 == &_min33); \
+ _min31 < _min32 ? (_min31 < _min33 ? _min31 : _min33) : \
+ (_min32 < _min33 ? _min32 : _min33); })
#define max3(x, y, z) ({ \
- typeof(x) _max1 = (x); \
- typeof(y) _max2 = (y); \
- typeof(z) _max3 = (z); \
- (void) (&_max1 == &_max2); \
- (void) (&_max1 == &_max3); \
- _max1 > _max2 ? (_max1 > _max3 ? _max1 : _max3) : \
- (_max2 > _max3 ? _max2 : _max3); })
+ typeof(x) _max31 = (x); \
+ typeof(y) _max32 = (y); \
+ typeof(z) _max33 = (z); \
+ (void) (&_max31 == &_max32); \
+ (void) (&_max31 == &_max33); \
+ _max31 > _max32 ? (_max31 > _max33 ? _max31 : _max33) : \
+ (_max32 > _max33 ? _max32 : _max33); })
/**
* min_not_zero - return the minimum that is _not_ zero, unless both are zero
--
1.9.3
reply other threads:[~2014-09-04 13:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1409836737-29469-1-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.d.rustad@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®