From: Zhengchao Shao Date: Mon, 26 Sep 2022 10:21:58 +0000 (+0800) Subject: net: sched: act_bpf: simplify code logic in tcf_bpf_init() X-Git-Tag: v6.6.17~6504^2~77 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8fff09effb0720d13a52eb227bf0f23c4e4b9989;p=platform%2Fkernel%2Flinux-rpi.git net: sched: act_bpf: simplify code logic in tcf_bpf_init() Both is_bpf and is_ebpf are boolean types, so (!is_bpf && !is_ebpf) || (is_bpf && is_ebpf) can be reduced to is_bpf == is_ebpf in tcf_bpf_init(). Signed-off-by: Zhengchao Shao Signed-off-by: David S. Miller --- diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index c5dbb68e..b79eee4 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c @@ -333,7 +333,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla, is_bpf = tb[TCA_ACT_BPF_OPS_LEN] && tb[TCA_ACT_BPF_OPS]; is_ebpf = tb[TCA_ACT_BPF_FD]; - if ((!is_bpf && !is_ebpf) || (is_bpf && is_ebpf)) { + if (is_bpf == is_ebpf) { ret = -EINVAL; goto put_chain; }