[PATCH 1/6] arm64: Make basic compat_* types always available

From: Deepa Dinamani
Date: Tue Jul 03 2018 - 01:45:18 EST


As we repurpose more compat syscalls to be used in non CONFIG_COMPAT
usecases as part of solving y2038, we need to make these basic types
available unconditionally.

Signed-off-by: Deepa Dinamani <deepa.kernel@xxxxxxxxx>
Cc: catalin.marinas@xxxxxxx
---
arch/arm64/include/asm/compat.h | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h
index 1a037b94eba1..2dbb179b5dc4 100644
--- a/arch/arm64/include/asm/compat.h
+++ b/arch/arm64/include/asm/compat.h
@@ -16,21 +16,14 @@
#ifndef __ASM_COMPAT_H
#define __ASM_COMPAT_H
#ifdef __KERNEL__
-#ifdef CONFIG_COMPAT

-/*
- * Architecture specific compatibility types
- */
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/sched/task_stack.h>

-#define COMPAT_USER_HZ 100
-#ifdef __AARCH64EB__
-#define COMPAT_UTS_MACHINE "armv8b\0\0"
-#else
-#define COMPAT_UTS_MACHINE "armv8l\0\0"
-#endif
+/*
+ * Architecture specific compatibility types
+ */

typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
@@ -65,6 +58,15 @@ typedef u32 compat_ulong_t;
typedef u64 compat_u64;
typedef u32 compat_uptr_t;

+#ifdef CONFIG_COMPAT
+
+#define COMPAT_USER_HZ 100
+#ifdef __AARCH64EB__
+#define COMPAT_UTS_MACHINE "armv8b\0\0"
+#else
+#define COMPAT_UTS_MACHINE "armv8l\0\0"
+#endif
+
struct compat_stat {
#ifdef __AARCH64EB__
short st_dev;
--
2.17.1