aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-05-07 15:34:30 +0100
committerDavid S. Miller <davem@davemloft.net>2020-05-07 18:07:40 -0700
commit3a13f98b4c16fb3489bdfd7550fcaa333ee69850 (patch)
tree28d5793e21767a2833da06910ec00d252d591b14 /drivers/net
parentnet/smc: remove set but not used variables 'del_llc, del_llc_resp' (diff)
downloadlinux-dev-3a13f98b4c16fb3489bdfd7550fcaa333ee69850.tar.xz
linux-dev-3a13f98b4c16fb3489bdfd7550fcaa333ee69850.zip
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 <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/phy_device.c2
1 files changed, 1 insertions, 1 deletions
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;