Skip to content

Commit 76ad33e

Browse files
krzkpalmer-dabbelt
authored andcommitted
riscv: traps_misaligned: do not duplicate stringify
Use existing stringify macro from the kernel headers. Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 8eb060e commit 76ad33e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

arch/riscv/kernel/traps_misaligned.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/mm.h>
88
#include <linux/module.h>
99
#include <linux/irq.h>
10+
#include <linux/stringify.h>
1011

1112
#include <asm/processor.h>
1213
#include <asm/ptrace.h>
@@ -150,9 +151,6 @@
150151
#define PRECISION_S 0
151152
#define PRECISION_D 1
152153

153-
#define STR(x) XSTR(x)
154-
#define XSTR(x) #x
155-
156154
#define DECLARE_UNPRIVILEGED_LOAD_FUNCTION(type, insn) \
157155
static inline type load_##type(const type *addr) \
158156
{ \
@@ -207,9 +205,9 @@ static inline ulong get_insn(ulong mepc)
207205
asm ("and %[tmp], %[addr], 2\n"
208206
"bnez %[tmp], 1f\n"
209207
#if defined(CONFIG_64BIT)
210-
STR(LWU) " %[insn], (%[addr])\n"
208+
__stringify(LWU) " %[insn], (%[addr])\n"
211209
#else
212-
STR(LW) " %[insn], (%[addr])\n"
210+
__stringify(LW) " %[insn], (%[addr])\n"
213211
#endif
214212
"and %[tmp], %[insn], %[rvc_mask]\n"
215213
"beq %[tmp], %[rvc_mask], 2f\n"

0 commit comments

Comments
 (0)