All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time'
@ 2020-05-08 12:00 Samuel Zou
  2020-05-08 13:00 ` Vladimir Oltean
  2020-05-09  5:32 ` Jakub Kicinski
  0 siblings, 2 replies; 3+ messages in thread
From: Samuel Zou @ 2020-05-08 12:00 UTC (permalink / raw)
  To: olteanv, andrew, vivien.didelot, f.fainelli, davem
  Cc: linux-kernel, netdev, Samuel Zou

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/net/dsa/sja1105/sja1105_vl.c:468:6: warning: variable ‘prev_time’ set but not used [-Wunused-but-set-variable]
  u32 prev_time = 0;
      ^~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Samuel Zou <zou_wei@huawei.com>
---
 drivers/net/dsa/sja1105/sja1105_vl.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c
index b52f1af..aa9b0b9 100644
--- a/drivers/net/dsa/sja1105/sja1105_vl.c
+++ b/drivers/net/dsa/sja1105/sja1105_vl.c
@@ -465,7 +465,6 @@ sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
 	struct sja1105_gate_entry *last_e;
 	struct sja1105_gate_entry *e;
 	struct list_head *prev;
-	u32 prev_time = 0;
 
 	list_for_each_entry(e, &gating_cfg->entries, list) {
 		struct sja1105_gate_entry *p;
@@ -476,7 +475,6 @@ sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
 			continue;
 
 		p = list_entry(prev, struct sja1105_gate_entry, list);
-		prev_time = e->interval;
 		p->interval = e->interval - p->interval;
 	}
 	last_e = list_last_entry(&gating_cfg->entries,
-- 
2.6.2


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

* Re: [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time'
  2020-05-08 12:00 [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time' Samuel Zou
@ 2020-05-08 13:00 ` Vladimir Oltean
  2020-05-09  5:32 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Vladimir Oltean @ 2020-05-08 13:00 UTC (permalink / raw)
  To: Samuel Zou
  Cc: Andrew Lunn, Vivien Didelot, Florian Fainelli, David S. Miller,
	lkml, netdev

Hi Samuel,

On Fri, 8 May 2020 at 14:55, Samuel Zou <zou_wei@huawei.com> wrote:
>
> Fixes gcc '-Wunused-but-set-variable' warning:
>
> drivers/net/dsa/sja1105/sja1105_vl.c:468:6: warning: variable ‘prev_time’ set but not used [-Wunused-but-set-variable]
>   u32 prev_time = 0;
>       ^~~~~~~~~
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Samuel Zou <zou_wei@huawei.com>
> ---

Thank you for the patch!

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>

>  drivers/net/dsa/sja1105/sja1105_vl.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/dsa/sja1105/sja1105_vl.c b/drivers/net/dsa/sja1105/sja1105_vl.c
> index b52f1af..aa9b0b9 100644
> --- a/drivers/net/dsa/sja1105/sja1105_vl.c
> +++ b/drivers/net/dsa/sja1105/sja1105_vl.c
> @@ -465,7 +465,6 @@ sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
>         struct sja1105_gate_entry *last_e;
>         struct sja1105_gate_entry *e;
>         struct list_head *prev;
> -       u32 prev_time = 0;
>
>         list_for_each_entry(e, &gating_cfg->entries, list) {
>                 struct sja1105_gate_entry *p;
> @@ -476,7 +475,6 @@ sja1105_gating_cfg_time_to_interval(struct sja1105_gating_config *gating_cfg,
>                         continue;
>
>                 p = list_entry(prev, struct sja1105_gate_entry, list);
> -               prev_time = e->interval;
>                 p->interval = e->interval - p->interval;
>         }
>         last_e = list_last_entry(&gating_cfg->entries,
> --
> 2.6.2
>

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

* Re: [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time'
  2020-05-08 12:00 [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time' Samuel Zou
  2020-05-08 13:00 ` Vladimir Oltean
@ 2020-05-09  5:32 ` Jakub Kicinski
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-05-09  5:32 UTC (permalink / raw)
  To: Samuel Zou
  Cc: olteanv, andrew, vivien.didelot, f.fainelli, davem, linux-kernel, netdev

On Fri, 8 May 2020 20:00:55 +0800 Samuel Zou wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/net/dsa/sja1105/sja1105_vl.c:468:6: warning: variable ‘prev_time’ set but not used [-Wunused-but-set-variable]
>   u32 prev_time = 0;
>       ^~~~~~~~~
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Samuel Zou <zou_wei@huawei.com>

Applied, thank you!

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

end of thread, other threads:[~2020-05-09  5:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08 12:00 [PATCH -next] net: dsa: sja1105: remove set but not used variable 'prev_time' Samuel Zou
2020-05-08 13:00 ` Vladimir Oltean
2020-05-09  5:32 ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.