Skip to content

Commit 7dd9eb6

Browse files
hardevsinh-1vineetgarc
authored andcommitted
ARC: bpf: Correct conditional check in 'check_jmp_32'
The original code checks 'if (ARC_CC_AL)', which is always true since ARC_CC_AL is a constant. This makes the check redundant and likely obscures the intention of verifying whether the jump is conditional. Updates the code to check cond == ARC_CC_AL instead, reflecting the intent to differentiate conditional from unconditional jumps. Suggested-by: Vadim Fedorenko <[email protected]> Reviewed-by: Vadim Fedorenko <[email protected]> Acked-by: Shahab Vahedi <[email protected]> Signed-off-by: Hardevsinh Palaniya <[email protected]> Signed-off-by: Vineet Gupta <[email protected]>
1 parent 4d93ffe commit 7dd9eb6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/arc/net/bpf_jit_arcv2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2916,7 +2916,7 @@ bool check_jmp_32(u32 curr_off, u32 targ_off, u8 cond)
29162916
addendum = (cond == ARC_CC_AL) ? 0 : INSN_len_normal;
29172917
disp = get_displacement(curr_off + addendum, targ_off);
29182918

2919-
if (ARC_CC_AL)
2919+
if (cond == ARC_CC_AL)
29202920
return is_valid_far_disp(disp);
29212921
else
29222922
return is_valid_near_disp(disp);

0 commit comments

Comments
 (0)