diff options
| author | Christophe Leroy <[email protected]> | 2021-05-20 13:50:43 +0000 |
|---|---|---|
| committer | Michael Ellerman <[email protected]> | 2021-06-16 13:35:57 +0000 |
| commit | 6c0d181daabcba286db9711eef8800b566fb1cce (patch) | |
| tree | 48021825a17d9f389b216409a3eaa0b0a1d800e7 /arch/powerpc/lib/code-patching.c | |
| parent | powerpc: Do not dereference code as 'struct ppc_inst' (uprobe, code-patching,... (diff) | |
| download | kernel-6c0d181daabcba286db9711eef8800b566fb1cce.tar.gz kernel-6c0d181daabcba286db9711eef8800b566fb1cce.zip | |
powerpc/lib/code-patching: Make instr_is_branch_to_addr() static
instr_is_branch_to_addr() is only used in code-patching.c
Make it static.
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/5f6b9c8c83170ed310953eac2f5b14539bfc964a.1621516826.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/lib/code-patching.c')
| -rw-r--r-- | arch/powerpc/lib/code-patching.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/powerpc/lib/code-patching.c b/arch/powerpc/lib/code-patching.c index 0308429b0d1a..82f2c1edb498 100644 --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -367,15 +367,6 @@ unsigned long branch_target(const struct ppc_inst *instr) return 0; } -int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr) -{ - if (instr_is_branch_iform(ppc_inst_read(instr)) || - instr_is_branch_bform(ppc_inst_read(instr))) - return branch_target(instr) == addr; - - return 0; -} - int translate_branch(struct ppc_inst *instr, const struct ppc_inst *dest, const struct ppc_inst *src) { @@ -410,6 +401,15 @@ void __patch_exception(int exc, unsigned long addr) #ifdef CONFIG_CODE_PATCHING_SELFTEST +static int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr) +{ + if (instr_is_branch_iform(ppc_inst_read(instr)) || + instr_is_branch_bform(ppc_inst_read(instr))) + return branch_target(instr) == addr; + + return 0; +} + static void __init test_trampoline(void) { asm ("nop;\n"); |
