net: dsa: sja1105: remove set but not used variable 'prev_time'
authorSamuel Zou <zou_wei@huawei.com>
Fri, 8 May 2020 12:00:55 +0000 (20:00 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 9 May 2020 05:30:50 +0000 (22:30 -0700)
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>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/sja1105/sja1105_vl.c

index b52f1af6e7e748dafd365f1f7b52051253181a0b..aa9b0b92f437185d8fab72e008823155372f8dee 100644 (file)
@@ -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,