[PATCH] Signedness issue in drivers/net/phy/phy_device.c
authorEric Sesterhenn <snakebyte@gmx.de>
Mon, 25 Sep 2006 23:39:22 +0000 (16:39 -0700)
committerJeff Garzik <jeff@garzik.org>
Tue, 26 Sep 2006 00:01:19 +0000 (20:01 -0400)
While checking gcc 4.1 -Wextra warnings, I stumbled across the following
two warnings:

drivers/net/phy/phy_device.c:528: warning: comparison of unsigned expression < 0 is always false
drivers/net/phy/phy_device.c:546: warning: comparison of unsigned expression < 0 is always false

Since phy_read() returns an integer and can return negative values, it seems
to me the best way to get proper error handling working again is to make val
an int.  Currently it is an u32, so the < 0 check always fails.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/phy/phy_device.c

index 2d1ecfdc80dbecbc5e345d4524803ecf49bba114..ecd3da151e2d2a17eca4dabf378a3cef41a341df 100644 (file)
@@ -522,7 +522,7 @@ EXPORT_SYMBOL(genphy_read_status);
 
 static int genphy_config_init(struct phy_device *phydev)
 {
-       u32 val;
+       int val;
        u32 features;
 
        /* For now, I'll claim that the generic driver supports