Skip to contentSkip to conversation

net: phy: Fix unsigned comparison with less than zero

PATCH In review Jiapeng Chong 3 participants 3 messages Oct 27, 2021 – Oct 28, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: Fix unsigned comparison with less than zero

Fix the following coccicheck warning:

./drivers/net/phy/at803x.c:493:5-10: WARNING: Unsigned expression compared with zero: value < 0.

Fixes ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")
---
 drivers/net/phy/at803x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/phy/at803x.c +1 -1
index f1cbe1f..dae95d9 100644
@@ -484,7 +484,7 @@ static int at803x_set_wol(struct phy_device *phydev,
 static void at803x_get_wol(struct phy_device *phydev,
 			   struct ethtool_wolinfo *wol)
 {
-	u32 value;
+	int value;
 
 	wol->supported = WAKE_MAGIC;
 	wol->wolopts = 0;
Signature · 1 line
1.8.3.1
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jiapeng Chong

Fix the following coccicheck warning:

./drivers/net/phy/at803x.c:493:5-10: WARNING: Unsigned expression compared with zero: value < 0.

Fixes ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")

Thanks!

Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
maintainer
#2 lore raw
In reply to Jiapeng Chong
Quoted 7 lines · On Wed, 27 Oct 2021 16:59:51 +0800 Jiapeng Chong wrote:

Fix the following coccicheck warning:

./drivers/net/phy/at803x.c:493:5-10: WARNING: Unsigned expression compared with zero: value < 0.

Fixes ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")

Please pay more attention.

This is not a correct fixes tag, take a look at the code, the comparison was introduced in 7beecaf7d507 ("net: phy: at803x: improve the WOL feature").

Do not fix spelling of the quoted commits. You replaced seperate with separate and I had fun time trying to figure out why scripts complain that the fixes tag is incorrect.

Fixed and applied to net-next.