diff mbox

frv: Use OFFSET macro in DEF_*REG()

Message ID 20170403194636.96438-1-mka@chromium.org (mailing list archive)
State New, archived
Headers show

Commit Message

Matthias Kaehlcke April 3, 2017, 7:46 p.m. UTC
Avoid code duplication by using OFFSET() in DEF_*REG() instead of
replicating the macro.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
---
 arch/frv/kernel/asm-offsets.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

Comments

Matthias Kaehlcke April 17, 2017, 8:35 p.m. UTC | #1
El Mon, Apr 03, 2017 at 12:46:36PM -0700 Matthias Kaehlcke ha dit:

> Avoid code duplication by using OFFSET() in DEF_*REG() instead of
> replicating the macro.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>

Ping, any feedback on this patch?

Thanks

Matthias
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Masahiro Yamada April 18, 2017, 8:26 a.m. UTC | #2
2017-04-18 5:35 GMT+09:00 Matthias Kaehlcke <mka@chromium.org>:
> El Mon, Apr 03, 2017 at 12:46:36PM -0700 Matthias Kaehlcke ha dit:
>
>> Avoid code duplication by using OFFSET() in DEF_*REG() instead of
>> replicating the macro.
>>
>> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
>
> Ping, any feedback on this patch?
>
> Thanks
>
> Matthias

If this is not picked up via frv tree,
I will apply it to kbuild tree.

(frv does not seem very active these days.)

Let's wait a bit and see if we get a response.
David Howells April 18, 2017, 9:59 a.m. UTC | #3
Matthias Kaehlcke <mka@chromium.org> wrote:

> 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>
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Masahiro Yamada April 18, 2017, 10:14 a.m. UTC | #4
Hi David,

2017-04-18 18:59 GMT+09:00 David Howells <dhowells@redhat.com>:
> Matthias Kaehlcke <mka@chromium.org> wrote:
>
>> 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>


Ah, I've just noticed you are the last frv maintainer,
and now the frv is orphan.

So, I will pick up this patch to the kbuild tree.

Thanks!
Masahiro Yamada April 23, 2017, 6:54 a.m. UTC | #5
2017-04-18 18:59 GMT+09:00 David Howells <dhowells@redhat.com>:
> Matthias Kaehlcke <mka@chromium.org> wrote:
>
>> 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>
> --


Applied to linux-kbuild/kbuild.
diff mbox

Patch

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)
 {