linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] taprio: remove unused variable 'entry_list_policy'
@ 2019-08-08 14:26 YueHaibing
  2019-08-08 18:38 ` David Miller
  2019-08-09  1:49 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 6+ messages in thread
From: YueHaibing @ 2019-08-08 14:26 UTC (permalink / raw)
  To: davem, jhs, xiyou.wangcong, jiri, vinicius.gomes
  Cc: linux-kernel, netdev, YueHaibing

net/sched/sch_taprio.c:680:32: warning:
 entry_list_policy defined but not used [-Wunused-const-variable=]

It is not used since commit a3d43c0d56f1 ("taprio: Add
support adding an admin schedule")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 net/sched/sch_taprio.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index c39db50..046fd2c 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -677,10 +677,6 @@ static const struct nla_policy entry_policy[TCA_TAPRIO_SCHED_ENTRY_MAX + 1] = {
 	[TCA_TAPRIO_SCHED_ENTRY_INTERVAL]  = { .type = NLA_U32 },
 };
 
-static const struct nla_policy entry_list_policy[TCA_TAPRIO_SCHED_MAX + 1] = {
-	[TCA_TAPRIO_SCHED_ENTRY] = { .type = NLA_NESTED },
-};
-
 static const struct nla_policy taprio_policy[TCA_TAPRIO_ATTR_MAX + 1] = {
 	[TCA_TAPRIO_ATTR_PRIOMAP]	       = {
 		.len = sizeof(struct tc_mqprio_qopt)
-- 
2.7.4



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

* Re: [PATCH net-next] taprio: remove unused variable 'entry_list_policy'
  2019-08-08 14:26 [PATCH net-next] taprio: remove unused variable 'entry_list_policy' YueHaibing
@ 2019-08-08 18:38 ` David Miller
  2019-08-08 20:42   ` Vinicius Costa Gomes
  2019-08-09  1:49 ` [PATCH v2 " YueHaibing
  1 sibling, 1 reply; 6+ messages in thread
From: David Miller @ 2019-08-08 18:38 UTC (permalink / raw)
  To: yuehaibing
  Cc: jhs, xiyou.wangcong, jiri, vinicius.gomes, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 8 Aug 2019 22:26:23 +0800

> net/sched/sch_taprio.c:680:32: warning:
>  entry_list_policy defined but not used [-Wunused-const-variable=]
> 
> It is not used since commit a3d43c0d56f1 ("taprio: Add
> support adding an admin schedule")
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

This is probably unintentional and a bug, we should be using that
policy value to validate that the sched list is indeed a nested
attribute.

I'm not applying this without at least a better and clear commit
message explaining why we shouldn't be using this policy any more.

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

* Re: [PATCH net-next] taprio: remove unused variable 'entry_list_policy'
  2019-08-08 18:38 ` David Miller
@ 2019-08-08 20:42   ` Vinicius Costa Gomes
  2019-08-09  1:33     ` Yuehaibing
  0 siblings, 1 reply; 6+ messages in thread
From: Vinicius Costa Gomes @ 2019-08-08 20:42 UTC (permalink / raw)
  To: David Miller, yuehaibing; +Cc: jhs, xiyou.wangcong, jiri, linux-kernel, netdev

Hi,

David Miller <davem@davemloft.net> writes:

> From: YueHaibing <yuehaibing@huawei.com>
> Date: Thu, 8 Aug 2019 22:26:23 +0800
>
>> net/sched/sch_taprio.c:680:32: warning:
>>  entry_list_policy defined but not used [-Wunused-const-variable=]
>> 
>> It is not used since commit a3d43c0d56f1 ("taprio: Add
>> support adding an admin schedule")
>> 
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> This is probably unintentional and a bug, we should be using that
> policy value to validate that the sched list is indeed a nested
> attribute.

Removing this policy should be fine.

One of the points of commit (as explained in the commit message)
a3d43c0d56f1 ("taprio: Add support adding an admin schedule") is that it
removes support (it now returns "not supported") for schedules using the
TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY attribute (which were never used),
the parsing of those types of schedules was the only user of this
policy.

>
> I'm not applying this without at least a better and clear commit
> message explaining why we shouldn't be using this policy any more.

YueHaibing may use the text above in the commit message of a new spin of
this patch if you think it's clear enough.


Cheers,
--
Vinicius

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

* Re: [PATCH net-next] taprio: remove unused variable 'entry_list_policy'
  2019-08-08 20:42   ` Vinicius Costa Gomes
@ 2019-08-09  1:33     ` Yuehaibing
  0 siblings, 0 replies; 6+ messages in thread
From: Yuehaibing @ 2019-08-09  1:33 UTC (permalink / raw)
  To: Vinicius Costa Gomes, David Miller
  Cc: jhs, xiyou.wangcong, jiri, linux-kernel, netdev

On 2019/8/9 4:42, Vinicius Costa Gomes wrote:
> Hi,
> 
> David Miller <davem@davemloft.net> writes:
> 
>> From: YueHaibing <yuehaibing@huawei.com>
>> Date: Thu, 8 Aug 2019 22:26:23 +0800
>>
>>> net/sched/sch_taprio.c:680:32: warning:
>>>  entry_list_policy defined but not used [-Wunused-const-variable=]
>>>
>>> It is not used since commit a3d43c0d56f1 ("taprio: Add
>>> support adding an admin schedule")
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>
>> This is probably unintentional and a bug, we should be using that
>> policy value to validate that the sched list is indeed a nested
>> attribute.
> 
> Removing this policy should be fine.
> 
> One of the points of commit (as explained in the commit message)
> a3d43c0d56f1 ("taprio: Add support adding an admin schedule") is that it
> removes support (it now returns "not supported") for schedules using the
> TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY attribute (which were never used),
> the parsing of those types of schedules was the only user of this
> policy.
> 
>>
>> I'm not applying this without at least a better and clear commit
>> message explaining why we shouldn't be using this policy any more.
> 
> YueHaibing may use the text above in the commit message of a new spin of
> this patch if you think it's clear enough.

Thanks, will send v2 with your explanation.

> 
> 
> Cheers,
> --
> Vinicius
> 
> .
> 


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

* [PATCH v2 net-next] taprio: remove unused variable 'entry_list_policy'
  2019-08-08 14:26 [PATCH net-next] taprio: remove unused variable 'entry_list_policy' YueHaibing
  2019-08-08 18:38 ` David Miller
@ 2019-08-09  1:49 ` YueHaibing
  2019-08-09 20:41   ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: YueHaibing @ 2019-08-09  1:49 UTC (permalink / raw)
  To: davem, jhs, xiyou.wangcong, jiri, vinicius.gomes
  Cc: linux-kernel, netdev, YueHaibing

net/sched/sch_taprio.c:680:32: warning:
 entry_list_policy defined but not used [-Wunused-const-variable=]

One of the points of commit a3d43c0d56f1 ("taprio: Add support adding
an admin schedule") is that it removes support (it now returns "not
supported") for schedules using the TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY
attribute (which were never used), the parsing of those types of schedules
was the only user of this policy. So removing this policy should be fine.

Reported-by: Hulk Robot <hulkci@huawei.com>
Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: respin commit log using Vinicius's explanation.
---
 net/sched/sch_taprio.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/net/sched/sch_taprio.c b/net/sched/sch_taprio.c
index c39db50..046fd2c 100644
--- a/net/sched/sch_taprio.c
+++ b/net/sched/sch_taprio.c
@@ -677,10 +677,6 @@ static const struct nla_policy entry_policy[TCA_TAPRIO_SCHED_ENTRY_MAX + 1] = {
 	[TCA_TAPRIO_SCHED_ENTRY_INTERVAL]  = { .type = NLA_U32 },
 };
 
-static const struct nla_policy entry_list_policy[TCA_TAPRIO_SCHED_MAX + 1] = {
-	[TCA_TAPRIO_SCHED_ENTRY] = { .type = NLA_NESTED },
-};
-
 static const struct nla_policy taprio_policy[TCA_TAPRIO_ATTR_MAX + 1] = {
 	[TCA_TAPRIO_ATTR_PRIOMAP]	       = {
 		.len = sizeof(struct tc_mqprio_qopt)
-- 
2.7.4



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

* Re: [PATCH v2 net-next] taprio: remove unused variable 'entry_list_policy'
  2019-08-09  1:49 ` [PATCH v2 " YueHaibing
@ 2019-08-09 20:41   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-08-09 20:41 UTC (permalink / raw)
  To: yuehaibing
  Cc: jhs, xiyou.wangcong, jiri, vinicius.gomes, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Fri, 9 Aug 2019 09:49:23 +0800

> net/sched/sch_taprio.c:680:32: warning:
>  entry_list_policy defined but not used [-Wunused-const-variable=]
> 
> One of the points of commit a3d43c0d56f1 ("taprio: Add support adding
> an admin schedule") is that it removes support (it now returns "not
> supported") for schedules using the TCA_TAPRIO_ATTR_SCHED_SINGLE_ENTRY
> attribute (which were never used), the parsing of those types of schedules
> was the only user of this policy. So removing this policy should be fine.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v2: respin commit log using Vinicius's explanation.

Applied.

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

end of thread, other threads:[~2019-08-09 20:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-08 14:26 [PATCH net-next] taprio: remove unused variable 'entry_list_policy' YueHaibing
2019-08-08 18:38 ` David Miller
2019-08-08 20:42   ` Vinicius Costa Gomes
2019-08-09  1:33     ` Yuehaibing
2019-08-09  1:49 ` [PATCH v2 " YueHaibing
2019-08-09 20:41   ` David Miller

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