netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: act_bpf: simplify code logic in tcf_bpf_init()
@ 2022-09-26 10:21 Zhengchao Shao
  2022-09-28  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Zhengchao Shao @ 2022-09-26 10:21 UTC (permalink / raw)
  To: netdev, bpf, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba,
	pabeni, martin.lau, daniel
  Cc: weiyongjun1, yuehaibing, shaozhengchao

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>
---
 net/sched/act_bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c
index c5dbb68e6b78..b79eee44e24e 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;
 	}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: sched: act_bpf: simplify code logic in tcf_bpf_init()
  2022-09-26 10:21 [PATCH net-next] net: sched: act_bpf: simplify code logic in tcf_bpf_init() Zhengchao Shao
@ 2022-09-28  8:40 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-28  8:40 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, bpf, jhs, xiyou.wangcong, jiri, davem, edumazet, kuba,
	pabeni, martin.lau, daniel, weiyongjun1, yuehaibing

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon, 26 Sep 2022 18:21:58 +0800 you wrote:
> 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>
> ---
>  net/sched/act_bpf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: sched: act_bpf: simplify code logic in tcf_bpf_init()
    https://git.kernel.org/netdev/net-next/c/8fff09effb07

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-28  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-26 10:21 [PATCH net-next] net: sched: act_bpf: simplify code logic in tcf_bpf_init() Zhengchao Shao
2022-09-28  8:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).