From: Colin Ian King Date: Thu, 7 May 2020 14:34:30 +0000 (+0100) Subject: net: phy: fix less than zero comparison with unsigned variable val X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3a13f98b4c16fb3489bdfd7550fcaa333ee69850;p=openwrt%2Fstaging%2Fblogic.git net: phy: fix less than zero comparison with unsigned variable val The unsigned variable val is being checked for an error by checking if it is less than zero. This can never occur because val is unsigned. Fix this by making val a plain int. Addresses-Coverity: ("Unsigned compared against zero") Fixes: bdbdac7649fa ("ethtool: provide UAPI for PHY master/slave configuration.") Signed-off-by: Colin Ian King Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 83fc8e1b5793..c3a107cf578e 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1948,7 +1948,7 @@ static int genphy_setup_master_slave(struct phy_device *phydev) static int genphy_read_master_slave(struct phy_device *phydev) { int cfg, state; - u16 val; + int val; if (!phydev->is_gigabit_capable) { phydev->master_slave_get = MASTER_SLAVE_CFG_UNSUPPORTED;