Skip to content

Commit 29813a2

Browse files
arndbdennisszhou
authored andcommitted
asm-generic: percpu: avoid Wshadow warning
Nesting macros that use the same local variable names causes warnings when building with "make W=2": include/asm-generic/percpu.h:117:14: warning: declaration of '__ret' shadows a previous local [-Wshadow] include/asm-generic/percpu.h:126:14: warning: declaration of '__ret' shadows a previous local [-Wshadow] These are fairly harmless, but since the warning comes from a global header, the warning happens every time the headers are included, which is fairly annoying. Rename the variables to avoid shadowing and shut up the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> Signed-off-by: Dennis Zhou <dennis@kernel.org>
1 parent 3650b22 commit 29813a2

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

include/asm-generic/percpu.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,21 @@ do { \
114114

115115
#define __this_cpu_generic_read_nopreempt(pcp) \
116116
({ \
117-
typeof(pcp) __ret; \
117+
typeof(pcp) ___ret; \
118118
preempt_disable_notrace(); \
119-
__ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
119+
___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \
120120
preempt_enable_notrace(); \
121-
__ret; \
121+
___ret; \
122122
})
123123

124124
#define __this_cpu_generic_read_noirq(pcp) \
125125
({ \
126-
typeof(pcp) __ret; \
127-
unsigned long __flags; \
128-
raw_local_irq_save(__flags); \
129-
__ret = raw_cpu_generic_read(pcp); \
130-
raw_local_irq_restore(__flags); \
131-
__ret; \
126+
typeof(pcp) ___ret; \
127+
unsigned long ___flags; \
128+
raw_local_irq_save(___flags); \
129+
___ret = raw_cpu_generic_read(pcp); \
130+
raw_local_irq_restore(___flags); \
131+
___ret; \
132132
})
133133

134134
#define this_cpu_generic_read(pcp) \

0 commit comments

Comments
 (0)