arm64: is_compat_task is defined both in asm/compat.h and linux/compat.h
authorAKASHI Takahiro <takahiro.akashi@linaro.org>
Wed, 30 Apr 2014 09:51:32 +0000 (10:51 +0100)
committerJP Abgrall <jpa@google.com>
Thu, 18 Sep 2014 01:21:04 +0000 (18:21 -0700)
Some kernel files may include both linux/compat.h and asm/compat.h directly
or indirectly. Since both header files contain is_compat_task() under
!CONFIG_COMPAT, compiling them with !CONFIG_COMPAT will eventually fail.
Such files include kernel/auditsc.c, kernel/seccomp.c and init/do_mountfs.c
(do_mountfs.c may read asm/compat.h via asm/ftrace.h once ftrace is
implemented).

So this patch proactively
1) removes is_compat_task() under !CONFIG_COMPAT from asm/compat.h
2) replaces asm/compat.h to linux/compat.h in kernel/*.c,
   but asm/compat.h is still necessary in ptrace.c and process.c because
   they use is_compat_thread().

Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Conflicts:
arch/arm64/kernel/hw_breakpoint.c
arch/arm64/kernel/ptrace.c

Change-Id: I5b8330e43ab8bdd383cd410d8223d6c1a39fa0fc

arch/arm64/include/asm/compat.h
arch/arm64/kernel/hw_breakpoint.c
arch/arm64/kernel/process.c
arch/arm64/kernel/signal.c

index 7058eec269abb16ede741ad6be7ab096b27db6d7..ae0004fe6c230b354187a77b44981001763a889b 100644 (file)
@@ -291,11 +291,6 @@ static inline int is_compat_thread(struct thread_info *thread)
 
 #else /* !CONFIG_COMPAT */
 
-static inline int is_compat_task(void)
-{
-       return 0;
-}
-
 static inline int is_compat_thread(struct thread_info *thread)
 {
        return 0;
index 5ab825c59db9f87ae70fb76d604d12ae1f0d7243..68e371ea1bdae794e3da5636f00677cb513986ea 100644 (file)
 
 #define pr_fmt(fmt) "hw-breakpoint: " fmt
 
+#include <linux/compat.h>
 #include <linux/errno.h>
 #include <linux/hw_breakpoint.h>
 #include <linux/perf_event.h>
 #include <linux/ptrace.h>
 #include <linux/smp.h>
 
-#include <asm/compat.h>
 #include <asm/current.h>
 #include <asm/debug-monitors.h>
 #include <asm/hw_breakpoint.h>
index 7c11c74f7f545295aca8e5311d8bd960b6742db5..977ca8aa7dd10064af262b1e53800d2b23ca5acd 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <stdarg.h>
 
+#include <linux/compat.h>
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
index 882f01774365671f5a8fbe096514db81805c9286..182b6fc0119045ea88fbbded2c1696f285485dac 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <linux/compat.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/personality.h>
@@ -25,7 +26,6 @@
 #include <linux/tracehook.h>
 #include <linux/ratelimit.h>
 
-#include <asm/compat.h>
 #include <asm/debug-monitors.h>
 #include <asm/elf.h>
 #include <asm/cacheflush.h>