[tip:timers/core] sparc: compat: Allow including asm/compat.h for 32-bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  e4da0d6872db4aa12426057cb67059c4dee7df09
Gitweb:     https://git.kernel.org/tip/e4da0d6872db4aa12426057cb67059c4dee7df09
Author:     Arnd Bergmann <arnd@xxxxxxxx>
AuthorDate: Wed, 11 Apr 2018 14:36:21 +0200
Committer:  Arnd Bergmann <arnd@xxxxxxxx>
CommitDate: Thu, 19 Apr 2018 13:29:40 +0200

sparc: compat: Allow including asm/compat.h for 32-bit

We have several files on sparc that include linux/compat.h and expect
asm/compat.h not to be included for 32-bit builds, otherwise we get a
build failure.

Since we need to include asm/compat.h for compat time_t handling on all
32-bit architectures now, this hides some portions of asm/compat.h in
order to let the rest of the file get included.

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
 arch/sparc/include/asm/compat.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h
index 615283e16f22..1898b6223160 100644
--- a/arch/sparc/include/asm/compat.h
+++ b/arch/sparc/include/asm/compat.h
@@ -168,6 +168,7 @@ static inline compat_uptr_t ptr_to_compat(void __user *uptr)
 	return (u32)(unsigned long)uptr;
 }
 
+#ifdef CONFIG_COMPAT
 static inline void __user *arch_compat_alloc_user_space(long len)
 {
 	struct pt_regs *regs = current_thread_info()->kregs;
@@ -184,6 +185,7 @@ static inline void __user *arch_compat_alloc_user_space(long len)
 
 	return (void __user *) usp;
 }
+#endif
 
 struct compat_ipc64_perm {
 	compat_key_t key;
@@ -243,6 +245,7 @@ struct compat_shmid64_ds {
 	unsigned int	__unused2;
 };
 
+#ifdef CONFIG_COMPAT
 static inline int is_compat_task(void)
 {
 	return test_thread_flag(TIF_32BIT);
@@ -254,5 +257,6 @@ static inline bool in_compat_syscall(void)
 	return pt_regs_trap_type(current_pt_regs()) == 0x110;
 }
 #define in_compat_syscall in_compat_syscall
+#endif
 
 #endif /* _ASM_SPARC64_COMPAT_H */
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux