linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: make <linux/uaccess.h> self-contained for ARM
@ 2023-09-26 17:22 Masahiro Yamada
  2023-09-26 17:28 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: Masahiro Yamada @ 2023-09-26 17:22 UTC (permalink / raw)
  To: patches; +Cc: linux-kernel, Russell King, Masahiro Yamada, linux-arm-kernel

When I compiled the following code for ARM, I encountered numerous
errors.

[Test Code]

    #include <linux/compiler.h>
    #include <linux/uaccess.h>

    int foo(int *x, int __user *ptr)
    {
            return get_user(*x, ptr);
    }

To fix them, make some asm headers self-contained:

 1. In arch/arm/include/asm/traps.h, include <linux/init.h> for __init,
    and <linux/linkage.h> for asmlinkage.

 2. In arch/arm/include/asm/domain.h, include <linux/thread_info.h>
    for current_thread_info().

 3. In arch/arm/include/asm/uaccess.h, include <linux/kernel.h> for
    might_fault().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

KernelVersion: v6.6-rc1

 arch/arm/include/asm/domain.h  | 2 +-
 arch/arm/include/asm/traps.h   | 2 ++
 arch/arm/include/asm/uaccess.h | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
index 41536feb4392..d48859fdf32c 100644
--- a/arch/arm/include/asm/domain.h
+++ b/arch/arm/include/asm/domain.h
@@ -8,8 +8,8 @@
 #define __ASM_PROC_DOMAIN_H
 
 #ifndef __ASSEMBLY__
+#include <linux/thread_info.h>
 #include <asm/barrier.h>
-#include <asm/thread_info.h>
 #endif
 
 /*
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h
index 0aaefe3e1700..d44df9eac170 100644
--- a/arch/arm/include/asm/traps.h
+++ b/arch/arm/include/asm/traps.h
@@ -2,6 +2,8 @@
 #ifndef _ASMARM_TRAP_H
 #define _ASMARM_TRAP_H
 
+#include <linux/init.h>
+#include <linux/linkage.h>
 #include <linux/list.h>
 
 struct pt_regs;
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index bb5c81823117..6a2cc57f015a 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -8,6 +8,7 @@
 /*
  * User space memory access functions
  */
+#include <linux/kernel.h>
 #include <linux/string.h>
 #include <asm/page.h>
 #include <asm/domain.h>
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: make <linux/uaccess.h> self-contained for ARM
  2023-09-26 17:22 [PATCH] ARM: make <linux/uaccess.h> self-contained for ARM Masahiro Yamada
@ 2023-09-26 17:28 ` Russell King (Oracle)
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2023-09-26 17:28 UTC (permalink / raw)
  To: Masahiro Yamada; +Cc: patches, linux-kernel, linux-arm-kernel

On Wed, Sep 27, 2023 at 02:22:53AM +0900, Masahiro Yamada wrote:
> When I compiled the following code for ARM, I encountered numerous
> errors.
> 
> [Test Code]
> 
>     #include <linux/compiler.h>
>     #include <linux/uaccess.h>
> 
>     int foo(int *x, int __user *ptr)
>     {
>             return get_user(*x, ptr);
>     }
> 
> To fix them, make some asm headers self-contained:
> 
>  1. In arch/arm/include/asm/traps.h, include <linux/init.h> for __init,
>     and <linux/linkage.h> for asmlinkage.

Please drop the __init marking instead of adding linux/init.h, it's
not necessary.

Thanks.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] ARM: make <linux/uaccess.h> self-contained for ARM
@ 2023-09-27 17:06 Masahiro Yamada
  0 siblings, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2023-09-27 17:06 UTC (permalink / raw)
  To: patches; +Cc: linux-kernel, Russell King, Masahiro Yamada, linux-arm-kernel

When I compiled the following code for ARM, I encountered numerous
errors.

[Test Code]

    #include <linux/compiler.h>
    #include <linux/uaccess.h>

    int foo(int *x, int __user *ptr)
    {
            return get_user(*x, ptr);
    }

To fix the errors, make some asm headers self-contained:

 1. In arch/arm/include/asm/domain.h, include <linux/thread_info.h>
    for current_thread_info().

 2. In arch/arm/include/asm/traps.h, remove unneeded  __init, and
    include <linux/linkage.h> for asmlinkage.

 3. In arch/arm/include/asm/uaccess.h, include <linux/kernel.h> for
    might_fault().

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

KernelVersion: v6.6-rc1


 arch/arm/include/asm/domain.h  | 2 +-
 arch/arm/include/asm/traps.h   | 3 ++-
 arch/arm/include/asm/uaccess.h | 1 +
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h
index 41536feb4392..d48859fdf32c 100644
--- a/arch/arm/include/asm/domain.h
+++ b/arch/arm/include/asm/domain.h
@@ -8,8 +8,8 @@
 #define __ASM_PROC_DOMAIN_H
 
 #ifndef __ASSEMBLY__
+#include <linux/thread_info.h>
 #include <asm/barrier.h>
-#include <asm/thread_info.h>
 #endif
 
 /*
diff --git a/arch/arm/include/asm/traps.h b/arch/arm/include/asm/traps.h
index 0aaefe3e1700..2621b9fb9b19 100644
--- a/arch/arm/include/asm/traps.h
+++ b/arch/arm/include/asm/traps.h
@@ -2,6 +2,7 @@
 #ifndef _ASMARM_TRAP_H
 #define _ASMARM_TRAP_H
 
+#include <linux/linkage.h>
 #include <linux/list.h>
 
 struct pt_regs;
@@ -28,7 +29,7 @@ static inline int __in_irqentry_text(unsigned long ptr)
 	       ptr < (unsigned long)&__irqentry_text_end;
 }
 
-extern void __init early_trap_init(void *);
+extern void early_trap_init(void *);
 extern void dump_backtrace_entry(unsigned long where, unsigned long from,
 				 unsigned long frame, const char *loglvl);
 extern void ptrace_break(struct pt_regs *regs);
diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h
index bb5c81823117..6a2cc57f015a 100644
--- a/arch/arm/include/asm/uaccess.h
+++ b/arch/arm/include/asm/uaccess.h
@@ -8,6 +8,7 @@
 /*
  * User space memory access functions
  */
+#include <linux/kernel.h>
 #include <linux/string.h>
 #include <asm/page.h>
 #include <asm/domain.h>
-- 
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2023-09-27 17:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26 17:22 [PATCH] ARM: make <linux/uaccess.h> self-contained for ARM Masahiro Yamada
2023-09-26 17:28 ` Russell King (Oracle)
  -- strict thread matches above, loose matches on Subject: below --
2023-09-27 17:06 Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).