summaryrefslogtreecommitdiff
path: root/arch/frv
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2017-04-03 22:46:36 +0300
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-04-18 19:12:19 +0300
commit20c994e4d806e0c656b5fe0d14b17896b73a086c (patch)
tree902a781cca4aed6e6b6f2d87d0d96eb5387d6e58 /arch/frv
parent90ad4052e85cece1bbae064ff4b14088de35df29 (diff)
downloadlinux-20c994e4d806e0c656b5fe0d14b17896b73a086c.tar.xz
frv: Use OFFSET macro in DEF_*REG()
Avoid code duplication by using OFFSET() in DEF_*REG() instead of replicating the macro. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> Reviewed-by: David Howells <dhowells@redhat.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/frv')
-rw-r--r--arch/frv/kernel/asm-offsets.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/arch/frv/kernel/asm-offsets.c b/arch/frv/kernel/asm-offsets.c
index 8414293f213a..20c5b79b55f9 100644
--- a/arch/frv/kernel/asm-offsets.c
+++ b/arch/frv/kernel/asm-offsets.c
@@ -14,21 +14,10 @@
#include <asm/thread_info.h>
#include <asm/gdb-stub.h>
-#define DEF_PTREG(sym, reg) \
- asm volatile("\n->" #sym " %0 offsetof(struct pt_regs, " #reg ")" \
- : : "i" (offsetof(struct pt_regs, reg)))
-
-#define DEF_IREG(sym, reg) \
- asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \
- : : "i" (offsetof(struct user_context, reg)))
-
-#define DEF_FREG(sym, reg) \
- asm volatile("\n->" #sym " %0 offsetof(struct user_context, " #reg ")" \
- : : "i" (offsetof(struct user_context, reg)))
-
-#define DEF_0REG(sym, reg) \
- asm volatile("\n->" #sym " %0 offsetof(struct frv_frame0, " #reg ")" \
- : : "i" (offsetof(struct frv_frame0, reg)))
+#define DEF_PTREG(sym, reg) OFFSET(sym, pt_regs, reg)
+#define DEF_IREG(sym, reg) OFFSET(sym, user_context, reg)
+#define DEF_FREG(sym, reg) OFFSET(sym, user_context, reg)
+#define DEF_0REG(sym, reg) OFFSET(sym, frv_frame0, reg)
void foo(void)
{