x86: pageattr.c fix shadowed variable warning
PATCH 1/1 x86: pageattr.c fix shadowed variable warning
irqs_disabled() uses flags internally, use _flags to avoid shadowing code calling into this macro.
Introduced between 2.6.25-rc3 and -rc4
Fixes the sparse warning:arch/x86/mm/pageattr.c:383:21: warning: symbol 'flags' shadows an earlier one arch/x86/mm/pageattr.c:369:16: originally declared here
---
This was the only new sparse warning introduced between -rc3 and -rc4 on an X86_32 allyesconfig.
include/linux/irqflags.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
include/linux/irqflags.h +3 -3
@@ -84,10 +84,10 @@#define irqs_disabled () \ ({ \ - unsigned long flags; \ + unsigned long _flags; \ \ - raw_local_save_flags(flags); \ - raw_irqs_disabled_flags(flags); \ + raw_local_save_flags(_flags); \ + raw_irqs_disabled_flags(_flags); \ })#define irqs_disabled_flags (flags) raw_irqs_disabled_flags(flags)
Signature · 1 line
1.5.4.GIT
Quoted 2 lines · Harvey Harrison
irqs_disabled()uses flags internally, use_flagsto avoid shadowing code calling into this macro.
thanks Harvey, applied.
Ingo
Quoted 6 lines · Ingo Molnar
Quoted 2 lines · Harvey Harrison
irqs_disabled()uses flags internally, use_flagsto avoid shadowing code calling into this macro.thanks Harvey, applied.
Sorry I gave that patch such a poor name...although the warning shows in pageattr.c, the patch itself is for include/linux/irqflags.h
Harvey