[patch 11/19] sis900 warning fixes

2007-03-06 Thread akpm
From: Andrew Morton [EMAIL PROTECTED]

drivers/net/sis900.c: In function 'sis900_reset_phy':
drivers/net/sis900.c:972: warning: 'status' may be used uninitialized in this 
function
drivers/net/sis900.c: In function 'sis900_check_mode':
drivers/net/sis900.c:1431: warning: 'status' may be used uninitialized in this 
function
drivers/net/sis900.c: In function 'sis900_timer':
drivers/net/sis900.c:1467: warning: 'status' may be used uninitialized in this 
function


Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/sis900.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff -puN drivers/net/sis900.c~sis900-warning-fixes drivers/net/sis900.c
--- a/drivers/net/sis900.c~sis900-warning-fixes
+++ a/drivers/net/sis900.c
@@ -968,10 +968,10 @@ static void mdio_write(struct net_device
 
 static u16 sis900_reset_phy(struct net_device *net_dev, int phy_addr)
 {
-   int i = 0;
+   int i;
u16 status;
 
-   while (i++  2)
+   for (i = 0; i  2; i++)
status = mdio_read(net_dev, phy_addr, MII_STATUS);
 
mdio_write( net_dev, phy_addr, MII_CONTROL, MII_CNTL_RESET );
@@ -1430,7 +1430,7 @@ static void sis900_auto_negotiate(struct
int i = 0;
u32 status;
 
-   while (i++  2)
+   for (i = 0; i  2; i++)
status = mdio_read(net_dev, phy_addr, MII_STATUS);
 
if (!(status  MII_STAT_LINK)){
@@ -1466,9 +1466,9 @@ static void sis900_read_mode(struct net_
int phy_addr = sis_priv-cur_phy;
u32 status;
u16 autoadv, autorec;
-   int i = 0;
+   int i;
 
-   while (i++  2)
+   for (i = 0; i  2; i++)
status = mdio_read(net_dev, phy_addr, MII_STATUS);
 
if (!(status  MII_STAT_LINK))
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [patch 11/19] sis900 warning fixes

2007-03-06 Thread Jeff Garzik

[EMAIL PROTECTED] wrote:

diff -puN drivers/net/sis900.c~sis900-warning-fixes drivers/net/sis900.c
--- a/drivers/net/sis900.c~sis900-warning-fixes
+++ a/drivers/net/sis900.c
@@ -1430,7 +1430,7 @@ static void sis900_auto_negotiate(struct
int i = 0;
u32 status;
 
-	while (i++  2)

+   for (i = 0; i  2; i++)
status = mdio_read(net_dev, phy_addr, MII_STATUS);
 
 	if (!(status  MII_STAT_LINK)){


applied, though, you missed killing a redundant initialization


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html