linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2,net-next] net/sched: remove return value of unregister_tcf_proto_ops
@ 2022-07-11  8:09 Zhengchao Shao
  2022-07-13  1:09 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Zhengchao Shao @ 2022-07-11  8:09 UTC (permalink / raw)
  To: linux-kernel, netdev, jhs, xiyou.wangcong, jiri, davem, edumazet,
	kuba, pabeni
  Cc: weiyongjun1, yuehaibing, shaozhengchao

Return value of unregister_tcf_proto_ops is unused, remove it.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
v1: need to warn if unregister failed. 

 include/net/pkt_cls.h | 2 +-
 net/sched/cls_api.c   | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 8cf001aed858..d9d90e6925e1 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -23,7 +23,7 @@ struct tcf_walker {
 };
 
 int register_tcf_proto_ops(struct tcf_proto_ops *ops);
-int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
+void unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
 
 struct tcf_block_ext_info {
 	enum flow_block_binder_type binder_type;
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 9bb4d3dcc994..d20dd1532b48 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -194,7 +194,7 @@ EXPORT_SYMBOL(register_tcf_proto_ops);
 
 static struct workqueue_struct *tc_filter_wq;
 
-int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
+void unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
 {
 	struct tcf_proto_ops *t;
 	int rc = -ENOENT;
@@ -214,7 +214,10 @@ int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
 		}
 	}
 	write_unlock(&cls_mod_lock);
-	return rc;
+
+	if (rc)
+		pr_warn("unregister tc filter kind(%s) failed\n", ops->kind);
+
 }
 EXPORT_SYMBOL(unregister_tcf_proto_ops);
 
-- 
2.17.1


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

* Re: [PATCH v2,net-next] net/sched: remove return value of unregister_tcf_proto_ops
  2022-07-11  8:09 [PATCH v2,net-next] net/sched: remove return value of unregister_tcf_proto_ops Zhengchao Shao
@ 2022-07-13  1:09 ` Jakub Kicinski
  2022-07-13  1:45   ` 答复: " shaozhengchao
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-07-13  1:09 UTC (permalink / raw)
  To: Zhengchao Shao
  Cc: linux-kernel, netdev, jhs, xiyou.wangcong, jiri, davem, edumazet,
	pabeni, weiyongjun1, yuehaibing

On Mon, 11 Jul 2022 16:09:10 +0800 Zhengchao Shao wrote:
> Return value of unregister_tcf_proto_ops is unused, remove it.

> -int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
> +void unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
>  {
>  	struct tcf_proto_ops *t;
>  	int rc = -ENOENT;
> @@ -214,7 +214,10 @@ int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
>  		}
>  	}
>  	write_unlock(&cls_mod_lock);
> -	return rc;
> +

> +	if (rc)
> +		pr_warn("unregister tc filter kind(%s) failed\n", ops->kind);

I was saying WARN, by which I meant:

WARN(rc, "unregister tc filter kind(%s) failed %d\n", ops->kind, rc);

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

* 答复: [PATCH v2,net-next] net/sched: remove return value of unregister_tcf_proto_ops
  2022-07-13  1:09 ` Jakub Kicinski
@ 2022-07-13  1:45   ` shaozhengchao
  0 siblings, 0 replies; 3+ messages in thread
From: shaozhengchao @ 2022-07-13  1:45 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: linux-kernel, netdev, jhs, xiyou.wangcong, jiri, davem, edumazet,
	pabeni, weiyongjun (A),
	yuehaibing



-----邮件原件-----
发件人: Jakub Kicinski [mailto:kuba@kernel.org] 
发送时间: 2022年7月13日 9:09
收件人: shaozhengchao <shaozhengchao@huawei.com>
抄送: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; jhs@mojatatu.com; xiyou.wangcong@gmail.com; jiri@resnulli.us; davem@davemloft.net; edumazet@google.com; pabeni@redhat.com; weiyongjun (A) <weiyongjun1@huawei.com>; yuehaibing <yuehaibing@huawei.com>
主题: Re: [PATCH v2,net-next] net/sched: remove return value of unregister_tcf_proto_ops

On Mon, 11 Jul 2022 16:09:10 +0800 Zhengchao Shao wrote:
> Return value of unregister_tcf_proto_ops is unused, remove it.

> -int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
> +void unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
>  {
>  	struct tcf_proto_ops *t;
>  	int rc = -ENOENT;
> @@ -214,7 +214,10 @@ int unregister_tcf_proto_ops(struct tcf_proto_ops *ops)
>  		}
>  	}
>  	write_unlock(&cls_mod_lock);
> -	return rc;
> +

> +	if (rc)
> +		pr_warn("unregister tc filter kind(%s) failed\n", ops->kind);

I was saying WARN, by which I meant:

WARN(rc, "unregister tc filter kind(%s) failed %d\n", ops->kind, rc);

Hi Jakub:
	Thank you for your reply. I will fix it.

Zhangchao Shao


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

end of thread, other threads:[~2022-07-13  1:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11  8:09 [PATCH v2,net-next] net/sched: remove return value of unregister_tcf_proto_ops Zhengchao Shao
2022-07-13  1:09 ` Jakub Kicinski
2022-07-13  1:45   ` 答复: " 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).