]> git.baikalelectronics.ru Git - kernel.git/commitdiff
powerpc/lib/code-patching: Make instr_is_branch_to_addr() static
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 20 May 2021 13:50:43 +0000 (13:50 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 16 Jun 2021 13:35:57 +0000 (23:35 +1000)
instr_is_branch_to_addr() is only used in code-patching.c

Make it static.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5f6b9c8c83170ed310953eac2f5b14539bfc964a.1621516826.git.christophe.leroy@csgroup.eu
arch/powerpc/include/asm/code-patching.h
arch/powerpc/lib/code-patching.c

index 22957c6068c81792e7b80b2ce84301a46301ccab..fd60594bdd38e356e72987db9be405016c4c12b2 100644 (file)
@@ -59,7 +59,6 @@ static inline int modify_instruction_site(s32 *site, unsigned int clr, unsigned
 
 int instr_is_relative_branch(struct ppc_inst instr);
 int instr_is_relative_link_branch(struct ppc_inst instr);
-int instr_is_branch_to_addr(const struct ppc_inst *instr, unsigned long addr);
 unsigned long branch_target(const struct ppc_inst *instr);
 int translate_branch(struct ppc_inst *instr, const struct ppc_inst *dest,
                     const struct ppc_inst *src);
index 0308429b0d1a356f87b0d9b02d850ab6fb68650c..82f2c1edb4980893932185e20ed45583d4e672b5 100644 (file)
@@ -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");