* [patch 11/19] sis900 warning fixes
@ 2007-03-06 10:41 akpm
2007-03-06 11:15 ` Jeff Garzik
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2007-03-06 10:41 UTC (permalink / raw)
To: jeff; +Cc: netdev, akpm
From: Andrew Morton <akpm@linux-foundation.org>
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 <akpm@linux-foundation.org>
---
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))
_
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [patch 11/19] sis900 warning fixes
2007-03-06 10:41 [patch 11/19] sis900 warning fixes akpm
@ 2007-03-06 11:15 ` Jeff Garzik
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Garzik @ 2007-03-06 11:15 UTC (permalink / raw)
To: akpm; +Cc: netdev
akpm@linux-foundation.org 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-03-06 11:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06 10:41 [patch 11/19] sis900 warning fixes akpm
2007-03-06 11:15 ` Jeff Garzik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).