Commit 97c97c6a authored by Alexander Lobakin's avatar Alexander Lobakin Committed by Thomas Bogendoerfer

MIPS: bitops: fix -Wshadow in asm/bitops.h

Solves the following repetitive warning when building with -Wshadow:

In file included from ./include/linux/bitops.h:32,
                 from ./include/linux/kernel.h:11,
                 from ./include/linux/skbuff.h:13,
                 from ./include/linux/if_ether.h:19,
                 from ./include/linux/etherdevice.h:20:
./arch/mips/include/asm/bitops.h: In function ‘test_and_set_bit_lock’:
./arch/mips/include/asm/bitops.h:46:16: warning: declaration of ‘orig’ shadows a previous local [-Wshadow]
   46 |  unsigned long orig, temp;    \
      |                ^~~~
./arch/mips/include/asm/bitops.h:190:10: note: in expansion of macro ‘__test_bit_op’
  190 |   orig = __test_bit_op(*m, "%0",
      |          ^~~~~~~~~~~~~
./arch/mips/include/asm/bitops.h:185:21: note: shadowed declaration is here
  185 |  unsigned long res, orig;
      |                     ^~~~
./arch/mips/include/asm/bitops.h: In function ‘test_and_clear_bit’:
./arch/mips/include/asm/bitops.h:46:16: warning: declaration of ‘orig’ shadows a previous local [-Wshadow]
   46 |  unsigned long orig, temp;    \
      |                ^~~~
./arch/mips/include/asm/bitops.h:236:9: note: in expansion of macro ‘__test_bit_op’
  236 |   res = __test_bit_op(*m, "%1",
      |         ^~~~~~~~~~~~~
./arch/mips/include/asm/bitops.h:229:21: note: shadowed declaration is here
  229 |  unsigned long res, orig;
      |                     ^~~~
./arch/mips/include/asm/bitops.h:46:16: warning: declaration of ‘orig’ shadows a previous local [-Wshadow]
   46 |  unsigned long orig, temp;    \
      |                ^~~~
./arch/mips/include/asm/bitops.h:241:10: note: in expansion of macro ‘__test_bit_op’
  241 |   orig = __test_bit_op(*m, "%0",
      |          ^~~~~~~~~~~~~
./arch/mips/include/asm/bitops.h:229:21: note: shadowed declaration is here
  229 |  unsigned long res, orig;
      |                     ^~~~
./arch/mips/include/asm/bitops.h: In function ‘test_and_change_bit’:
./arch/mips/include/asm/bitops.h:46:16: warning: declaration of ‘orig’ shadows a previous local [-Wshadow]
   46 |  unsigned long orig, temp;    \
      |                ^~~~
./arch/mips/include/asm/bitops.h:273:10: note: in expansion of macro ‘__test_bit_op’
  273 |   orig = __test_bit_op(*m, "%0",
      |          ^~~~~~~~~~~~~
./arch/mips/include/asm/bitops.h:266:21: note: shadowed declaration is here
  266 |  unsigned long res, orig;
      |                     ^~~~
Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent d3a4e0f1
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include <asm/war.h> #include <asm/war.h>
#define __bit_op(mem, insn, inputs...) do { \ #define __bit_op(mem, insn, inputs...) do { \
unsigned long temp; \ unsigned long __temp; \
\ \
asm volatile( \ asm volatile( \
" .set push \n" \ " .set push \n" \
...@@ -37,13 +37,13 @@ ...@@ -37,13 +37,13 @@
" " __SC "%0, %1 \n" \ " " __SC "%0, %1 \n" \
" " __SC_BEQZ "%0, 1b \n" \ " " __SC_BEQZ "%0, 1b \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r"(temp), "+" GCC_OFF_SMALL_ASM()(mem) \ : "=&r"(__temp), "+" GCC_OFF_SMALL_ASM()(mem) \
: inputs \ : inputs \
: __LLSC_CLOBBER); \ : __LLSC_CLOBBER); \
} while (0) } while (0)
#define __test_bit_op(mem, ll_dst, insn, inputs...) ({ \ #define __test_bit_op(mem, ll_dst, insn, inputs...) ({ \
unsigned long orig, temp; \ unsigned long __orig, __temp; \
\ \
asm volatile( \ asm volatile( \
" .set push \n" \ " .set push \n" \
...@@ -54,12 +54,12 @@ ...@@ -54,12 +54,12 @@
" " __SC "%1, %2 \n" \ " " __SC "%1, %2 \n" \
" " __SC_BEQZ "%1, 1b \n" \ " " __SC_BEQZ "%1, 1b \n" \
" .set pop \n" \ " .set pop \n" \
: "=&r"(orig), "=&r"(temp), \ : "=&r"(__orig), "=&r"(__temp), \
"+" GCC_OFF_SMALL_ASM()(mem) \ "+" GCC_OFF_SMALL_ASM()(mem) \
: inputs \ : inputs \
: __LLSC_CLOBBER); \ : __LLSC_CLOBBER); \
\ \
orig; \ __orig; \
}) })
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment