netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init()
@ 2022-08-29  7:17 Zhengchao Shao
  2022-08-31 19:30 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Zhengchao Shao @ 2022-08-29  7:17 UTC (permalink / raw)
  To: netdev, linux-kernel, davem, edumazet, kuba, pabeni, jhs,
	xiyou.wangcong, jiri
  Cc: weiyongjun1, yuehaibing, shaozhengchao

tcf_qevent_parse_block_index() has been checked the value of block_index.
Therefore, it is unnecessary to check the value of block_index in
tcf_qevent_init().

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 net/sched/cls_api.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 790d6809be81..72f5fd6e8e2d 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3639,9 +3639,6 @@ int tcf_qevent_init(struct tcf_qevent *qe, struct Qdisc *sch,
 	if (err)
 		return err;
 
-	if (!block_index)
-		return 0;
-
 	qe->info.binder_type = binder_type;
 	qe->info.chain_head_change = tcf_chain_head_change_dflt;
 	qe->info.chain_head_change_priv = &qe->filter_chain;
-- 
2.17.1


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

* Re: [PATCH net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init()
  2022-08-29  7:17 [PATCH net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init() Zhengchao Shao
@ 2022-08-31 19:30 ` Jakub Kicinski
  2022-09-01  1:04   ` shaozhengchao
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-08-31 19:30 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: netdev, linux-kernel, davem, edumazet, pabeni, jhs,
	xiyou.wangcong, jiri, weiyongjun1, yuehaibing

On Mon, 29 Aug 2022 15:17:20 +0800 Zhengchao Shao wrote:
> tcf_qevent_parse_block_index() has been checked the value of block_index.

Please rephrase this:

  tcf_qevent_parse_block_index() never returns a zero block_index.

Took me a while to figure out what you mean.

> Therefore, it is unnecessary to check the value of block_index in
> tcf_qevent_init().

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

* Re: [PATCH net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init()
  2022-08-31 19:30 ` Jakub Kicinski
@ 2022-09-01  1:04   ` shaozhengchao
  0 siblings, 0 replies; 3+ messages in thread
From: shaozhengchao @ 2022-09-01  1:04 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: netdev, linux-kernel, davem, edumazet, pabeni, jhs,
	xiyou.wangcong, jiri, weiyongjun1, yuehaibing



On 2022/9/1 3:30, Jakub Kicinski wrote:
> On Mon, 29 Aug 2022 15:17:20 +0800 Zhengchao Shao wrote:
>> tcf_qevent_parse_block_index() has been checked the value of block_index.
> 
> Please rephrase this:
> 
>    tcf_qevent_parse_block_index() never returns a zero block_index.
> 
> Took me a while to figure out what you mean.
> 
>> Therefore, it is unnecessary to check the value of block_index in
>> tcf_qevent_init().

Hi Jakub:
	Thank you for your reply. I will send v2.

Zhengchao Shao

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

end of thread, other threads:[~2022-09-01  1:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-29  7:17 [PATCH net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init() Zhengchao Shao
2022-08-31 19:30 ` Jakub Kicinski
2022-09-01  1:04   ` shaozhengchao

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).