Unverified Commit 76ad33e1 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Palmer Dabbelt
Browse files

riscv: traps_misaligned: do not duplicate stringify

parent 8eb060e1
Loading
Loading
Loading
Loading
+3 −5
Original line number Original line Diff line number Diff line
@@ -7,6 +7,7 @@
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/irq.h>
#include <linux/irq.h>
#include <linux/stringify.h>


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


#define STR(x) XSTR(x)
#define XSTR(x) #x

#define DECLARE_UNPRIVILEGED_LOAD_FUNCTION(type, insn)			\
#define DECLARE_UNPRIVILEGED_LOAD_FUNCTION(type, insn)			\
static inline type load_##type(const type *addr)			\
static inline type load_##type(const type *addr)			\
{									\
{									\
@@ -207,9 +205,9 @@ static inline ulong get_insn(ulong mepc)
	asm ("and %[tmp], %[addr], 2\n"
	asm ("and %[tmp], %[addr], 2\n"
		"bnez %[tmp], 1f\n"
		"bnez %[tmp], 1f\n"
#if defined(CONFIG_64BIT)
#if defined(CONFIG_64BIT)
		STR(LWU) " %[insn], (%[addr])\n"
		__stringify(LWU) " %[insn], (%[addr])\n"
#else
#else
		STR(LW) " %[insn], (%[addr])\n"
		__stringify(LW) " %[insn], (%[addr])\n"
#endif
#endif
		"and %[tmp], %[insn], %[rvc_mask]\n"
		"and %[tmp], %[insn], %[rvc_mask]\n"
		"beq %[tmp], %[rvc_mask], 2f\n"
		"beq %[tmp], %[rvc_mask], 2f\n"