Skip to content

Commit

Permalink
[PATCH] Signedness issue in drivers/net/phy/phy_device.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Sesterhenn authored and Jeff Garzik committed Sep 26, 2006
1 parent 0fe2480 commit 84c22d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/phy_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 84c22d7

Please sign in to comment.