diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-09-19 07:05:45 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2014-09-19 07:05:45 -0400 |
commit | 9f1ae7596aad71d18c3e88a3927f3f76b037b8fe (patch) | |
tree | ca4c896b2f2ab1abdefe9afe826a98131755ab6e /arch/arm64/kernel/ftrace.c | |
parent | a6583c7c8114c4850b57365e85da85e37d5fc568 (diff) |
arm64: Correct ftrace calls to aarch64_insn_gen_branch_imm()
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>
Diffstat (limited to 'arch/arm64/kernel/ftrace.c')
-rw-r--r-- | arch/arm64/kernel/ftrace.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm64/kernel/ftrace.c b/arch/arm64/kernel/ftrace.c index 7924d73b6476..cf8556ae09d0 100644 --- a/arch/arm64/kernel/ftrace.c +++ b/arch/arm64/kernel/ftrace.c | |||
@@ -58,7 +58,8 @@ int ftrace_update_ftrace_func(ftrace_func_t func) | |||
58 | u32 new; | 58 | u32 new; |
59 | 59 | ||
60 | pc = (unsigned long)&ftrace_call; | 60 | pc = (unsigned long)&ftrace_call; |
61 | new = aarch64_insn_gen_branch_imm(pc, (unsigned long)func, true); | 61 | new = aarch64_insn_gen_branch_imm(pc, (unsigned long)func, |
62 | AARCH64_INSN_BRANCH_LINK); | ||
62 | 63 | ||
63 | return ftrace_modify_code(pc, 0, new, false); | 64 | return ftrace_modify_code(pc, 0, new, false); |
64 | } | 65 | } |
@@ -72,7 +73,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) | |||
72 | u32 old, new; | 73 | u32 old, new; |
73 | 74 | ||
74 | old = aarch64_insn_gen_nop(); | 75 | old = aarch64_insn_gen_nop(); |
75 | new = aarch64_insn_gen_branch_imm(pc, addr, true); | 76 | new = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK); |
76 | 77 | ||
77 | return ftrace_modify_code(pc, old, new, true); | 78 | return ftrace_modify_code(pc, old, new, true); |
78 | } | 79 | } |
@@ -86,7 +87,7 @@ int ftrace_make_nop(struct module *mod, struct dyn_ftrace *rec, | |||
86 | unsigned long pc = rec->ip; | 87 | unsigned long pc = rec->ip; |
87 | u32 old, new; | 88 | u32 old, new; |
88 | 89 | ||
89 | old = aarch64_insn_gen_branch_imm(pc, addr, true); | 90 | old = aarch64_insn_gen_branch_imm(pc, addr, AARCH64_INSN_BRANCH_LINK); |
90 | new = aarch64_insn_gen_nop(); | 91 | new = aarch64_insn_gen_nop(); |
91 | 92 | ||
92 | return ftrace_modify_code(pc, old, new, true); | 93 | return ftrace_modify_code(pc, old, new, true); |
@@ -154,7 +155,8 @@ static int ftrace_modify_graph_caller(bool enable) | |||
154 | u32 branch, nop; | 155 | u32 branch, nop; |
155 | 156 | ||
156 | branch = aarch64_insn_gen_branch_imm(pc, | 157 | branch = aarch64_insn_gen_branch_imm(pc, |
157 | (unsigned long)ftrace_graph_caller, false); | 158 | (unsigned long)ftrace_graph_caller, |
159 | AARCH64_INSN_BRANCH_LINK); | ||
158 | nop = aarch64_insn_gen_nop(); | 160 | nop = aarch64_insn_gen_nop(); |
159 | 161 | ||
160 | if (enable) | 162 | if (enable) |