]> git.itanic.dy.fi Git - linux-stable/commitdiff
ARM: 9326/1: make <linux/uaccess.h> self-contained for ARM
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 27 Sep 2023 17:06:00 +0000 (18:06 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 5 Oct 2023 15:17:05 +0000 (16:17 +0100)
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>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/include/asm/domain.h
arch/arm/include/asm/traps.h
arch/arm/include/asm/uaccess.h

index 41536feb4392140798e33f1c736f70c9dd798563..d48859fdf32c501220c9bc48f961f73b946eb3fb 100644 (file)
@@ -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
 
 /*
index 0aaefe3e17008e1d468d0bad750bf9bebdcaef7b..2621b9fb9b19b064aa40a8ab4a3a89067b98a010 100644 (file)
@@ -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);
index c28f5ec21e417ba9afb81f2b5dc5eb476d8f3921..9556d04387f7c2048fcf60a1a9263650b9c307cc 100644 (file)
@@ -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>