Skip to content

Commit

Permalink
sis900: fix warning in drivers/net/sis900.c
Browse files Browse the repository at this point in the history
this warning:

  drivers/net/sis900.c: In function ‘sis900_timer’:
  drivers/net/sis900.c:1280: warning: ‘speed’ may be used uninitialized in this function

triggers because GCC does not recognize the (correct) error flow
between sis900_read_mode(), 'speed' and 'duplex'.

Annotate it.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ingo Molnar authored and David S. Miller committed Nov 26, 2008
1 parent 180b65d commit ef0cd87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/sis900.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,7 +1281,7 @@ static void sis900_timer(unsigned long data)
u16 status;

if (!sis_priv->autong_complete){
int speed, duplex = 0;
int uninitialized_var(speed), duplex = 0;

sis900_read_mode(net_dev, &speed, &duplex);
if (duplex){
Expand Down

0 comments on commit ef0cd87

Please sign in to comment.