Skip to content

Commit 8fff09e

Browse files
zhengchaoshaodavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6a1dc68 commit 8fff09e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/sched/act_bpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
333333
is_bpf = tb[TCA_ACT_BPF_OPS_LEN] && tb[TCA_ACT_BPF_OPS];
334334
is_ebpf = tb[TCA_ACT_BPF_FD];
335335

336-
if ((!is_bpf && !is_ebpf) || (is_bpf && is_ebpf)) {
336+
if (is_bpf == is_ebpf) {
337337
ret = -EINVAL;
338338
goto put_chain;
339339
}

0 commit comments

Comments
 (0)