mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-10 07:44:23 +08:00
powerpc/audit: Simplify syscall_get_arch()
Make use of is_32bit_task() and CONFIG_CPU_LITTLE_ENDIAN to simplify syscall_get_arch(). Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/4be53b9187a4d8c163968f4d224267e41a7fcc33.1629451479.git.christophe.leroy@csgroup.eu
This commit is contained in:
parent
898a1ef06a
commit
770cec16cd
@ -115,16 +115,11 @@ static inline void syscall_set_arguments(struct task_struct *task,
|
|||||||
|
|
||||||
static inline int syscall_get_arch(struct task_struct *task)
|
static inline int syscall_get_arch(struct task_struct *task)
|
||||||
{
|
{
|
||||||
int arch;
|
if (is_32bit_task())
|
||||||
|
return AUDIT_ARCH_PPC;
|
||||||
if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
|
else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
|
||||||
arch = AUDIT_ARCH_PPC64;
|
return AUDIT_ARCH_PPC64LE;
|
||||||
else
|
else
|
||||||
arch = AUDIT_ARCH_PPC;
|
return AUDIT_ARCH_PPC64;
|
||||||
|
|
||||||
#ifdef __LITTLE_ENDIAN__
|
|
||||||
arch |= __AUDIT_ARCH_LE;
|
|
||||||
#endif
|
|
||||||
return arch;
|
|
||||||
}
|
}
|
||||||
#endif /* _ASM_SYSCALL_H */
|
#endif /* _ASM_SYSCALL_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user