sis900: fix warning in drivers/net/sis900.c
authorIngo Molnar <mingo@elte.hu>
Wed, 26 Nov 2008 00:52:13 +0000 (16:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Nov 2008 00:52:13 +0000 (16:52 -0800)
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>
drivers/net/sis900.c

index de740ebfafb6ba5709efd5312a0d725aea5e87a8..eb715f1bcd48a86349d947b4bc1cae2824bb14b7 100644 (file)
@@ -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){