diff mbox series

[net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init()

Message ID 20220829071720.211589-1-shaozhengchao@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/sched: cls_api: remove redundant 0 check in tcf_qevent_init() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 9 this patch: 9
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 5 this patch: 5
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 9 this patch: 9
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Aug. 29, 2022, 7:17 a.m. UTC
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(-)

Comments

Jakub Kicinski Aug. 31, 2022, 7:30 p.m. UTC | #1
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().
shaozhengchao Sept. 1, 2022, 1:04 a.m. UTC | #2
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
diff mbox series

Patch

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;