Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <shaozhengchao@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Zhengchao Shao and committed by
David S. Miller
8fff09ef 6a1dc68e

+1 -1
+1 -1
net/sched/act_bpf.c
··· 333 333 is_bpf = tb[TCA_ACT_BPF_OPS_LEN] && tb[TCA_ACT_BPF_OPS]; 334 334 is_ebpf = tb[TCA_ACT_BPF_FD]; 335 335 336 - if ((!is_bpf && !is_ebpf) || (is_bpf && is_ebpf)) { 336 + if (is_bpf == is_ebpf) { 337 337 ret = -EINVAL; 338 338 goto put_chain; 339 339 }