summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/ftrace.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
index 610c852b92ed..4c75a1c0a5b4 100644
--- a/arch/powerpc/kernel/ftrace.c
+++ b/arch/powerpc/kernel/ftrace.c
@@ -31,11 +31,6 @@
#endif
#ifdef CONFIG_DYNAMIC_FTRACE
-static unsigned int ftrace_calc_offset(long ip, long addr)
-{
- return (int)(addr - ip);
-}
-
static unsigned int ftrace_nop_replace(void)
{
return PPC_NOP_INSTR;
@@ -46,17 +41,10 @@ ftrace_call_replace(unsigned long ip, unsigned long addr, int link)
{
unsigned int op;
- /*
- * It would be nice to just use create_function_call, but that will
- * update the code itself. Here we need to just return the
- * instruction that is going to be modified, without modifying the
- * code.
- */
addr = GET_ADDR(addr);
/* if (link) set op to 'bl' else 'b' */
- op = 0x48000000 | (link ? 1 : 0);
- op |= (ftrace_calc_offset(ip, addr) & 0x03fffffc);
+ op = create_branch((unsigned int *)ip, addr, link ? 1 : 0);
return op;
}