Skip to content

Commit b08ac66

Browse files
vh21ralfbaechle
authored andcommitted
MIPS: ftrace: Tweak safe_load()/safe_store() macros
Due to name collision in ftrace safe_load and safe_store macros, these macros cannot take expressions as operands. For example, compiler will complain for a macro call like the following: safe_store_code(new_code2, ip + 4, faulted); arch/mips/include/asm/ftrace.h:61:6: note: in definition of macro 'safe_store' : [dst] "r" (dst), [src] "r" (src)\ ^ arch/mips/kernel/ftrace.c:118:2: note: in expansion of macro 'safe_store_code' safe_store_code(new_code2, ip + 4, faulted); ^ arch/mips/kernel/ftrace.c:118:32: error: undefined named operand 'ip + 4' safe_store_code(new_code2, ip + 4, faulted); ^ arch/mips/include/asm/ftrace.h:61:6: note: in definition of macro 'safe_store' : [dst] "r" (dst), [src] "r" (src)\ ^ arch/mips/kernel/ftrace.c:118:2: note: in expansion of macro 'safe_store_code' safe_store_code(new_code2, ip + 4, faulted); ^ This build error is triggered by a467109 [MIPS: ftrace: Fix icache flush range error]. Tweak variable naming in those macros to allow flexible operands. Signed-off-by: Viller Hsiao <villerhsiao@gmail.com> Cc: linux-mips@linux-mips.org Cc: rostedt@goodmis.org Cc: fweisbec@gmail.com Cc: mingo@redhat.com Cc: Qais.Yousef@imgtec.com Patchwork: https://patchwork.linux-mips.org/patch/6622/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 4fe2169 commit b08ac66

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

arch/mips/include/asm/ftrace.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,43 +22,43 @@ extern void _mcount(void);
2222
#define safe_load(load, src, dst, error) \
2323
do { \
2424
asm volatile ( \
25-
"1: " load " %[" STR(dst) "], 0(%[" STR(src) "])\n"\
26-
" li %[" STR(error) "], 0\n" \
25+
"1: " load " %[tmp_dst], 0(%[tmp_src])\n" \
26+
" li %[tmp_err], 0\n" \
2727
"2:\n" \
2828
\
2929
".section .fixup, \"ax\"\n" \
30-
"3: li %[" STR(error) "], 1\n" \
30+
"3: li %[tmp_err], 1\n" \
3131
" j 2b\n" \
3232
".previous\n" \
3333
\
3434
".section\t__ex_table,\"a\"\n\t" \
3535
STR(PTR) "\t1b, 3b\n\t" \
3636
".previous\n" \
3737
\
38-
: [dst] "=&r" (dst), [error] "=r" (error)\
39-
: [src] "r" (src) \
38+
: [tmp_dst] "=&r" (dst), [tmp_err] "=r" (error)\
39+
: [tmp_src] "r" (src) \
4040
: "memory" \
4141
); \
4242
} while (0)
4343

4444
#define safe_store(store, src, dst, error) \
4545
do { \
4646
asm volatile ( \
47-
"1: " store " %[" STR(src) "], 0(%[" STR(dst) "])\n"\
48-
" li %[" STR(error) "], 0\n" \
47+
"1: " store " %[tmp_src], 0(%[tmp_dst])\n"\
48+
" li %[tmp_err], 0\n" \
4949
"2:\n" \
5050
\
5151
".section .fixup, \"ax\"\n" \
52-
"3: li %[" STR(error) "], 1\n" \
52+
"3: li %[tmp_err], 1\n" \
5353
" j 2b\n" \
5454
".previous\n" \
5555
\
5656
".section\t__ex_table,\"a\"\n\t"\
5757
STR(PTR) "\t1b, 3b\n\t" \
5858
".previous\n" \
5959
\
60-
: [error] "=r" (error) \
61-
: [dst] "r" (dst), [src] "r" (src)\
60+
: [tmp_err] "=r" (error) \
61+
: [tmp_dst] "r" (dst), [tmp_src] "r" (src)\
6262
: "memory" \
6363
); \
6464
} while (0)

0 commit comments

Comments
 (0)