[PATCH 2/4] powerpc: ftrace: Use ppc_function_entry() rather than hand-rolled macro

Michael Ellerman michael at ellerman.id.au
Thu Jul 17 17:21:31 EST 2008


Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
 arch/powerpc/kernel/ftrace.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 78f4423..1d6f174 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -19,14 +19,6 @@
 #include <asm/ftrace.h>
 
 
-#ifdef CONFIG_PPC32
-# define GET_ADDR(addr) addr
-#else
-/* PowerPC64's functions are data that points to the functions */
-# define GET_ADDR(addr) *(unsigned long *)addr
-#endif
-
-
 static unsigned int notrace ftrace_calc_offset(long ip, long addr)
 {
 	return (int)(addr - ip);
@@ -49,7 +41,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr)
 	 * instruction that is going to be modified, without modifying the
 	 * code.
 	 */
-	addr = GET_ADDR(addr);
+	addr = ppc_function_entry((void *)addr);
 
 	/* Set to "bl addr" */
 	op = 0x48000001 | (ftrace_calc_offset(ip, addr) & 0x03fffffc);
-- 
1.5.5




More information about the Linuxppc-dev mailing list