sparc: implement is_32bit_task
We are currently embedding the same check from thread_info.h into
syscall.h thanks to the way syscall_get_arch() was implemented in the
audit tree. Instead create a new function, is_32bit_task() which is
similar to that found on the powerpc arch. This simplifies the
syscall.h code and makes the build/Kconfig requirements much easier
to understand.
Signed-off-by: Eric Paris <eparis@redhat.com
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: sparclinux@vger.kernel.org
diff --git a/arch/sparc/include/asm/syscall.h b/arch/sparc/include/asm/syscall.h
index a5a8153..49f71fd 100644
--- a/arch/sparc/include/asm/syscall.h
+++ b/arch/sparc/include/asm/syscall.h
@@ -128,12 +128,7 @@
static inline int syscall_get_arch(void)
{
-#if defined(__sparc__) && defined(__arch64__)
- return test_thread_flag(TIF_32BIT) ? AUDIT_ARCH_SPARC
- : AUDIT_ARCH_SPARC64;
-#else
- return AUDIT_ARCH_SPARC;
-#endif
+ return is_32bit_task() ? AUDIT_ARCH_SPARC : AUDIT_ARCH_SPARC64;
}
#endif /* __ASM_SPARC_SYSCALL_H */