Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 770cec1

Browse files
chleroympe
authored andcommitted
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/4be53b9187a4d8c163968f4d224267e41a7fcc33.1629451479.git.christophe.leroy@csgroup.eu
1 parent 898a1ef commit 770cec1

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

arch/powerpc/include/asm/syscall.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,11 @@ static inline void syscall_set_arguments(struct task_struct *task,
115115

116116
static inline int syscall_get_arch(struct task_struct *task)
117117
{
118-
int arch;
119-
120-
if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
121-
arch = AUDIT_ARCH_PPC64;
118+
if (is_32bit_task())
119+
return AUDIT_ARCH_PPC;
120+
else if (IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN))
121+
return AUDIT_ARCH_PPC64LE;
122122
else
123-
arch = AUDIT_ARCH_PPC;
124-
125-
#ifdef __LITTLE_ENDIAN__
126-
arch |= __AUDIT_ARCH_LE;
127-
#endif
128-
return arch;
123+
return AUDIT_ARCH_PPC64;
129124
}
130125
#endif /* _ASM_SYSCALL_H */

0 commit comments

Comments
 (0)