projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a1dc68
)
net: sched: act_bpf: simplify code logic in tcf_bpf_init()
author
Zhengchao Shao
<shaozhengchao@huawei.com>
Mon, 26 Sep 2022 10:21:58 +0000
(18:21 +0800)
committer
David S. Miller
<davem@davemloft.net>
Wed, 28 Sep 2022 08:38:56 +0000
(09:38 +0100)
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>
net/sched/act_bpf.c
patch
|
blob
|
history
diff --git
a/net/sched/act_bpf.c
b/net/sched/act_bpf.c
index
c5dbb68
..
b79eee4
100644
(file)
--- 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;
}