arm64: Correct ftrace calls to aarch64_insn_gen_branch_imm()
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 19 Sep 2014 11:05:45 +0000 (12:05 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 19 Sep 2014 11:05:45 +0000 (12:05 +0100)
The aarch64_insn_gen_branch_imm() function takes an enum as the last
argument rather than a bool. It happens to work because
AARCH64_INSN_BRANCH_LINK matches 'true' but better to use the actual
type.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/ftrace.c

index 7924d73b64764e89170c57f3d84f8b7d7a0a5a57..cf8556ae09d04ad0c81855870aa052cef746f8e7 100644 (file)
@@ -58,7 +58,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func)
        u32 new;
 
        pc = (unsigned long)&ftrace_call;
-       new = aarch64_insn_gen_branch_imm(pc, (unsigned long)func, true);
+       new = aarch64_insn_gen_branch_imm(pc, (unsigned long)func,
+                                         AARCH64_INSN_BRANCH_LINK);
 
        return ftrace_modify_code(pc, 0, new, false);
 }
@@ -72,7 +73,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
        u32 old, new;
 
        old = aarch64_insn_gen_nop();
-       new = aarch64_insn_gen_branch_imm(pc, addr, true);
+       new = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK);
 
        return ftrace_modify_code(pc, old, new, true);
 }
@@ -86,7 +87,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec,
        unsigned long pc = rec->ip;
        u32 old, new;
 
-       old = aarch64_insn_gen_branch_imm(pc, addr, true);
+       old = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK);
        new = aarch64_insn_gen_nop();
 
        return ftrace_modify_code(pc, old, new, true);
@@ -154,7 +155,8 @@ static int ftrace_modify_graph_caller(bool enable)
        u32 branch, nop;
 
        branch = aarch64_insn_gen_branch_imm(pc,
-                       (unsigned long)ftrace_graph_caller, false);
+                                            (unsigned long)ftrace_graph_caller,
+                                            AARCH64_INSN_BRANCH_LINK);
        nop = aarch64_insn_gen_nop();
 
        if (enable)