From: Ralf Baechle Date: Thu, 16 Aug 2012 16:23:13 +0000 (+0200) Subject: MIPS: Move audit_arch() helper function to __syscall_get_arch(). X-Git-Tag: next-20120817~87^2^5~3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=764393e3b55c54d47f42172373f1e8bdae9640a7;p=karo-tx-linux.git MIPS: Move audit_arch() helper function to __syscall_get_arch(). Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h index 82b53110fecb..baaa4061357e 100644 --- a/arch/mips/include/asm/syscall.h +++ b/arch/mips/include/asm/syscall.h @@ -13,6 +13,7 @@ #ifndef __ASM_MIPS_SYSCALL_H #define __ASM_MIPS_SYSCALL_H +#include #include #include #include @@ -80,4 +81,16 @@ extern const unsigned long sys_call_table[]; extern const unsigned long sys32_call_table[]; extern const unsigned long sysn32_call_table[]; +static inline int __syscall_get_arch(void) +{ + int arch = EM_MIPS; +#ifdef CONFIG_64BIT + arch |= __AUDIT_ARCH_64BIT; +#endif +#if defined(__LITTLE_ENDIAN) + arch |= __AUDIT_ARCH_LE; +#endif + return arch; +} + #endif /* __ASM_MIPS_SYSCALL_H */ diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c index 826e523cbcc9..ea7ba4d10ae4 100644 --- a/arch/mips/kernel/ptrace.c +++ b/arch/mips/kernel/ptrace.c @@ -646,18 +646,6 @@ long arch_ptrace(struct task_struct *child, long request, return ret; } -static inline int audit_arch(void) -{ - int arch = EM_MIPS; -#ifdef CONFIG_64BIT - arch |= __AUDIT_ARCH_64BIT; -#endif -#if defined(__LITTLE_ENDIAN) - arch |= __AUDIT_ARCH_LE; -#endif - return arch; -} - /* * Notification of system call entry/exit * - triggered by current->work.syscall_trace @@ -670,7 +658,8 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs) if (test_thread_flag(TIF_SYSCALL_TRACE)) ptrace_report_syscall(regs); - audit_syscall_entry(audit_arch(), regs->regs[2], + audit_syscall_entry(__syscall_get_arch(), + regs->regs[2], regs->regs[4], regs->regs[5], regs->regs[6], regs->regs[7]); }