hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9R2TB
--------------------------------
Remove bracket in single branch of if statement.
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com --- arch/arm/kernel/livepatch.c | 3 +-- arch/arm64/kernel/livepatch.c | 3 +-- arch/powerpc/kernel/livepatch_32.c | 3 +-- arch/powerpc/kernel/livepatch_64.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/arm/kernel/livepatch.c b/arch/arm/kernel/livepatch.c index 3379fbf16dd4..a5f4c770990f 100644 --- a/arch/arm/kernel/livepatch.c +++ b/arch/arm/kernel/livepatch.c @@ -75,9 +75,8 @@ bool arch_check_jump_insn(unsigned long func_addr) u32 *insn = (u32*)func_addr;
for (i = 0; i < CHECK_JUMP_RANGE; i++) { - if (is_jump_insn(*insn)) { + if (is_jump_insn(*insn)) return true; - } insn++; } return false; diff --git a/arch/arm64/kernel/livepatch.c b/arch/arm64/kernel/livepatch.c index 6675569c8a4b..258f1dcda945 100644 --- a/arch/arm64/kernel/livepatch.c +++ b/arch/arm64/kernel/livepatch.c @@ -68,9 +68,8 @@ bool arch_check_jump_insn(unsigned long func_addr) u32 *insn = (u32*)func_addr;
for (i = 0; i < CHECK_JUMP_RANGE; i++) { - if (is_jump_insn(*insn)) { + if (is_jump_insn(*insn)) return true; - } insn++; } return false; diff --git a/arch/powerpc/kernel/livepatch_32.c b/arch/powerpc/kernel/livepatch_32.c index 73fdc4395fb6..7374adfb0cec 100644 --- a/arch/powerpc/kernel/livepatch_32.c +++ b/arch/powerpc/kernel/livepatch_32.c @@ -65,9 +65,8 @@ bool arch_check_jump_insn(unsigned long func_addr) u32 *insn = (u32*)func_addr;
for (i = 0; i < CHECK_JUMP_RANGE; i++) { - if (is_jump_insn(*insn)) { + if (is_jump_insn(*insn)) return true; - } insn++; } return false; diff --git a/arch/powerpc/kernel/livepatch_64.c b/arch/powerpc/kernel/livepatch_64.c index 79921c0bacc8..ef827b8e6230 100644 --- a/arch/powerpc/kernel/livepatch_64.c +++ b/arch/powerpc/kernel/livepatch_64.c @@ -70,9 +70,8 @@ static bool check_jump_insn(unsigned long func_addr) u32 *insn = (u32*)func_addr;
for (i = 0; i < CHECK_JUMP_RANGE; i++) { - if (is_jump_insn(*insn)) { + if (is_jump_insn(*insn)) return true; - } insn++; } return false;