[PATCH net-next] net: sched: red: remove unused input parameter in red_get_flags()

Zhengchao Shao posted 1 patch 3 years, 7 months ago
include/net/red.h   | 1 -
net/sched/sch_red.c | 4 ++--
2 files changed, 2 insertions(+), 3 deletions(-)
[PATCH net-next] net: sched: red: remove unused input parameter in red_get_flags()
Posted by Zhengchao Shao 3 years, 7 months ago
The input parameter supported_mask is unused in red_get_flags().
Remove it.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 include/net/red.h   | 1 -
 net/sched/sch_red.c | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/net/red.h b/include/net/red.h
index dad41eff8c62..4aed3b2d9725 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -192,7 +192,6 @@ static inline bool red_check_params(u32 qth_min, u32 qth_max, u8 Wlog,
 static inline int red_get_flags(unsigned char qopt_flags,
 				unsigned char historic_mask,
 				struct nlattr *flags_attr,
-				unsigned char supported_mask,
 				struct nla_bitfield32 *p_flags,
 				unsigned char *p_userbits,
 				struct netlink_ext_ack *extack)
diff --git a/net/sched/sch_red.c b/net/sched/sch_red.c
index cae3b80e4d9d..346c6c41ce56 100644
--- a/net/sched/sch_red.c
+++ b/net/sched/sch_red.c
@@ -258,8 +258,8 @@ static int __red_change(struct Qdisc *sch, struct nlattr **tb,
 		return -EINVAL;
 
 	err = red_get_flags(ctl->flags, TC_RED_HISTORIC_FLAGS,
-			    tb[TCA_RED_FLAGS], TC_RED_SUPPORTED_FLAGS,
-			    &flags_bf, &userbits, extack);
+			    tb[TCA_RED_FLAGS], &flags_bf, &userbits,
+			    extack);
 	if (err)
 		return err;
 
-- 
2.17.1
Re: [PATCH net-next] net: sched: red: remove unused input parameter in red_get_flags()
Posted by Cong Wang 3 years, 7 months ago
On Sat, Aug 27, 2022 at 12:35:45PM +0800, Zhengchao Shao wrote:
> The input parameter supported_mask is unused in red_get_flags().
> Remove it.
> 

It looks like this is incomplete code unification of the following
commit:

commit 14bc175d9c885c86239de3d730eea85ad67bfe7b
Author: Petr Machata <petrm@mellanox.com>
Date:   Fri Mar 13 01:10:56 2020 +0200

    net: sched: Allow extending set of supported RED flags

How about completing it? ;)

Thanks.
Re: [PATCH net-next] net: sched: red: remove unused input parameter in red_get_flags()
Posted by shaozhengchao 3 years, 7 months ago

On 2022/8/28 2:46, Cong Wang wrote:
> On Sat, Aug 27, 2022 at 12:35:45PM +0800, Zhengchao Shao wrote:
>> The input parameter supported_mask is unused in red_get_flags().
>> Remove it.
>>
> 
> It looks like this is incomplete code unification of the following
> commit:
> 
> commit 14bc175d9c885c86239de3d730eea85ad67bfe7b
> Author: Petr Machata <petrm@mellanox.com>
> Date:   Fri Mar 13 01:10:56 2020 +0200
> 
>      net: sched: Allow extending set of supported RED flags
> 
> How about completing it? ;)
> 
> Thanks.

Hi Wang:
	Thank you for your reply. Your suggestion is good. I will try to 
complete it later.

Zhengchao Shao