bpf, mips: No need to use min() to get MAX_TAIL_CALL_CNT
authorTiezhu Yang <yangtiezhu@loongson.cn>
Mon, 29 Aug 2022 03:05:09 +0000 (11:05 +0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 29 Aug 2022 13:38:14 +0000 (15:38 +0200)
commitbbcf0f55e57841e532ab395596db9197e8d53e8d
tree064f8ae5f1073140956797ba0d93b8a0ed9843ed
parentaa75622c3be4d5819ce69c714acbcbd67bba5d65
bpf, mips: No need to use min() to get MAX_TAIL_CALL_CNT

MAX_TAIL_CALL_CNT is 33, so min(MAX_TAIL_CALL_CNT, 0xffff) is always
MAX_TAIL_CALL_CNT, it is better to use MAX_TAIL_CALL_CNT directly.

At the same time, add BUILD_BUG_ON(MAX_TAIL_CALL_CNT > 0xffff) with a
comment on why the assertion is there.

Suggested-by: Daniel Borkmann <daniel@iogearbox.net>
Suggested-by: Johan Almbladh <johan.almbladh@anyfinetworks.com>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/1661742309-2320-1-git-send-email-yangtiezhu@loongson.cn
arch/mips/net/bpf_jit_comp32.c
arch/mips/net/bpf_jit_comp64.c