Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Arnd Bergmann and committed by
Dennis Zhou
29813a22 3650b228

+9 -9
+9 -9
include/asm-generic/percpu.h
··· 114 114 115 115 #define __this_cpu_generic_read_nopreempt(pcp) \ 116 116 ({ \ 117 - typeof(pcp) __ret; \ 117 + typeof(pcp) ___ret; \ 118 118 preempt_disable_notrace(); \ 119 - __ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \ 119 + ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \ 120 120 preempt_enable_notrace(); \ 121 - __ret; \ 121 + ___ret; \ 122 122 }) 123 123 124 124 #define __this_cpu_generic_read_noirq(pcp) \ 125 125 ({ \ 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; \ 132 132 }) 133 133 134 134 #define this_cpu_generic_read(pcp) \