Commit 51e0f058 authored by Ingo Molnar's avatar Ingo Molnar Committed by David S. Miller

niu: fix warnings in drivers/net/niu.c

these warnings:

  drivers/net/niu.c: In function ‘serdes_init_niu_1g_serdes’:
  drivers/net/niu.c:451: warning: ‘sig’ may be used uninitialized in this function
  drivers/net/niu.c: In function ‘serdes_init_niu_10g_serdes’:
  drivers/net/niu.c:550: warning: ‘sig’ may be used uninitialized in this function

triggers because GCC does not recognize that the max_retry loop
always initializes 'sig', due to max_retry != 0.

Annotate them.
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2e6a684b
...@@ -448,7 +448,7 @@ static int serdes_init_niu_1g_serdes(struct niu *np) ...@@ -448,7 +448,7 @@ static int serdes_init_niu_1g_serdes(struct niu *np)
struct niu_link_config *lp = &np->link_config; struct niu_link_config *lp = &np->link_config;
u16 pll_cfg, pll_sts; u16 pll_cfg, pll_sts;
int max_retry = 100; int max_retry = 100;
u64 sig, mask, val; u64 uninitialized_var(sig), mask, val;
u32 tx_cfg, rx_cfg; u32 tx_cfg, rx_cfg;
unsigned long i; unsigned long i;
int err; int err;
...@@ -547,7 +547,7 @@ static int serdes_init_niu_10g_serdes(struct niu *np) ...@@ -547,7 +547,7 @@ static int serdes_init_niu_10g_serdes(struct niu *np)
struct niu_link_config *lp = &np->link_config; struct niu_link_config *lp = &np->link_config;
u32 tx_cfg, rx_cfg, pll_cfg, pll_sts; u32 tx_cfg, rx_cfg, pll_cfg, pll_sts;
int max_retry = 100; int max_retry = 100;
u64 sig, mask, val; u64 uninitialized_var(sig), mask, val;
unsigned long i; unsigned long i;
int err; int err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment