[PATCH 2/2] x86: Resolve some shadow warnings
From: Jeff Kirsher
Date: Fri Jul 25 2014 - 10:43:25 EST
From: Mark Rustad <mark.d.rustad@xxxxxxxxx>
Resolve some shadow warnings and also eliminate some hazards
for possible name clashes on local variables declared in inner
blocks produced by those macros. Passing an outer variable with
the same name as an inner variable would cause serious confusion,
so prepend the inner variables with underscores to reduce the
exposure.
Signed-off-by: Mark Rustad <mark.d.rustad@xxxxxxxxx>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@xxxxxxxxx>
---
arch/x86/ia32/ia32_signal.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/arch/x86/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c
index f9e181a..11e4987 100644
--- a/arch/x86/ia32/ia32_signal.c
+++ b/arch/x86/ia32/ia32_signal.c
@@ -135,7 +135,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
#define loadsegment_ds(v) loadsegment(ds, v)
#define loadsegment_es(v) loadsegment(es, v)
-#define get_user_seg(seg) ({ unsigned int v; savesegment(seg, v); v; })
+#define get_user_seg(seg) ({ unsigned int _v; savesegment(seg, _v); _v; })
#define set_user_seg(seg, v) loadsegment_##seg(v)
#define COPY(x) { \
@@ -143,9 +143,9 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
}
#define GET_SEG(seg) ({ \
- unsigned short tmp; \
- get_user_ex(tmp, &sc->seg); \
- tmp; \
+ unsigned short _tmp; \
+ get_user_ex(_tmp, &sc->seg); \
+ _tmp; \
})
#define COPY_SEG_CPL3(seg) do { \
@@ -153,11 +153,11 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from)
} while (0)
#define RELOAD_SEG(seg) { \
- unsigned int pre = GET_SEG(seg); \
- unsigned int cur = get_user_seg(seg); \
- pre |= 3; \
- if (pre != cur) \
- set_user_seg(seg, pre); \
+ unsigned int _pre = GET_SEG(seg); \
+ unsigned int _cur = get_user_seg(seg); \
+ _pre |= 3; \
+ if (_pre != _cur) \
+ set_user_seg(seg, _pre); \
}
static int ia32_restore_sigcontext(struct pt_regs *regs,
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/