]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
MIPS: Move audit_arch() helper function to __syscall_get_arch().
authorRalf Baechle <ralf@linux-mips.org>
Thu, 16 Aug 2012 16:23:13 +0000 (18:23 +0200)
committerRalf Baechle <ralf@linux-mips.org>
Thu, 16 Aug 2012 22:24:13 +0000 (00:24 +0200)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/include/asm/syscall.h
arch/mips/kernel/ptrace.c

index 82b53110fecb4d966c316eb56548f1e18885a3f6..baaa4061357ed4b2a1c199a0a0b3c7b27d8b419d 100644 (file)
@@ -13,6 +13,7 @@
 #ifndef __ASM_MIPS_SYSCALL_H
 #define __ASM_MIPS_SYSCALL_H
 
+#include <linux/elf-em.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/uaccess.h>
@@ -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 */
index 826e523cbcc982d0d63d3957771d564003d5484b..ea7ba4d10ae48ed5f92cba48bce495dfc9785edb 100644 (file)
@@ -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]);
 }