2021-10-27 21:20:44

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] 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.

Reported-by: Abaci Robot <[email protected]>
Fixes: ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/net/phy/at803x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index f1cbe1f..dae95d9 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -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;
--
1.8.3.1


2021-10-27 21:21:08

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH] net: phy: Fix unsigned comparison with less than zero

On Wed, Oct 27, 2021 at 04:59:51PM +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.
>
> Reported-by: Abaci Robot <[email protected]>
> Fixes: ea13c9ee855c ("drivers: net: phy: at803x: separate wol specific code to wol standard apis")
> Signed-off-by: Jiapeng Chong <[email protected]>

Reviewed-by: Russell King (Oracle) <[email protected]>

Thanks!

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!