sparc64: Use kprobes_built_in() to avoid ifdefs in fault_64.c
authorDavid S. Miller <davem@davemloft.net>
Fri, 11 Dec 2009 02:02:19 +0000 (18:02 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Dec 2009 02:02:19 +0000 (18:02 -0800)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/mm/fault_64.c

index 43b0da96a4fb92c4a3f5e3e1eaac67ae611832e5..0aa50b200af809a863eb0705bcaedba0329ab65a 100644 (file)
 #include <asm/sections.h>
 #include <asm/mmu_context.h>
 
-#ifdef CONFIG_KPROBES
 static inline int notify_page_fault(struct pt_regs *regs)
 {
        int ret = 0;
 
        /* kprobe_running() needs smp_processor_id() */
-       if (!user_mode(regs)) {
+       if (kprobes_built_in() && !user_mode(regs)) {
                preempt_disable();
                if (kprobe_running() && kprobe_fault_handler(regs, 0))
                        ret = 1;
@@ -45,12 +44,6 @@ static inline int notify_page_fault(struct pt_regs *regs)
        }
        return ret;
 }
-#else
-static inline int notify_page_fault(struct pt_regs *regs)
-{
-       return 0;
-}
-#endif
 
 static void __kprobes unhandled_fault(unsigned long address,
                                      struct task_struct *tsk,