All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] frv: Use OFFSET macro in DEF_*REG()
@ 2017-04-03 19:46 Matthias Kaehlcke
  2017-04-17 20:35 ` Matthias Kaehlcke
  2017-04-18  9:59 ` David Howells
  0 siblings, 2 replies; 6+ messages in thread
From: Matthias Kaehlcke @ 2017-04-03 19:46 UTC (permalink / raw)
  To: David Howells; +Cc: linux-kernel, linux-kbuild, Matthias Kaehlcke

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

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)
 {
-- 
2.12.2.564.g063fe858b8-goog

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] frv: Use OFFSET macro in DEF_*REG()
  2017-04-03 19:46 [PATCH] frv: Use OFFSET macro in DEF_*REG() Matthias Kaehlcke
@ 2017-04-17 20:35 ` Matthias Kaehlcke
  2017-04-18  8:26   ` Masahiro Yamada
  2017-04-18  9:59 ` David Howells
  1 sibling, 1 reply; 6+ messages in thread
From: Matthias Kaehlcke @ 2017-04-17 20:35 UTC (permalink / raw)
  To: David Howells; +Cc: linux-kernel, linux-kbuild, Masahiro Yamada

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] frv: Use OFFSET macro in DEF_*REG()
  2017-04-17 20:35 ` Matthias Kaehlcke
@ 2017-04-18  8:26   ` Masahiro Yamada
  0 siblings, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2017-04-18  8:26 UTC (permalink / raw)
  To: Matthias Kaehlcke
  Cc: David Howells, Linux Kernel Mailing List, Linux Kbuild mailing list

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.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] frv: Use OFFSET macro in DEF_*REG()
  2017-04-03 19:46 [PATCH] frv: Use OFFSET macro in DEF_*REG() Matthias Kaehlcke
  2017-04-17 20:35 ` Matthias Kaehlcke
@ 2017-04-18  9:59 ` David Howells
  2017-04-18 10:14   ` Masahiro Yamada
  2017-04-23  6:54   ` Masahiro Yamada
  1 sibling, 2 replies; 6+ messages in thread
From: David Howells @ 2017-04-18  9:59 UTC (permalink / raw)
  To: Matthias Kaehlcke; +Cc: dhowells, linux-kernel, linux-kbuild

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] frv: Use OFFSET macro in DEF_*REG()
  2017-04-18  9:59 ` David Howells
@ 2017-04-18 10:14   ` Masahiro Yamada
  2017-04-23  6:54   ` Masahiro Yamada
  1 sibling, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2017-04-18 10:14 UTC (permalink / raw)
  To: David Howells
  Cc: Matthias Kaehlcke, Linux Kernel Mailing List, Linux Kbuild mailing list

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!



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] frv: Use OFFSET macro in DEF_*REG()
  2017-04-18  9:59 ` David Howells
  2017-04-18 10:14   ` Masahiro Yamada
@ 2017-04-23  6:54   ` Masahiro Yamada
  1 sibling, 0 replies; 6+ messages in thread
From: Masahiro Yamada @ 2017-04-23  6:54 UTC (permalink / raw)
  To: David Howells, Matthias Kaehlcke
  Cc: Linux Kernel Mailing List, Linux Kbuild mailing list

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.


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-04-23  6:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-03 19:46 [PATCH] frv: Use OFFSET macro in DEF_*REG() Matthias Kaehlcke
2017-04-17 20:35 ` Matthias Kaehlcke
2017-04-18  8:26   ` Masahiro Yamada
2017-04-18  9:59 ` David Howells
2017-04-18 10:14   ` Masahiro Yamada
2017-04-23  6:54   ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.