Skip to content

Commit

Permalink
net: phy: fix less than zero comparison with unsigned variable val
Browse files Browse the repository at this point in the history
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: bdbdac7 ("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>
  • Loading branch information
Colin Ian King authored and David S. Miller committed May 8, 2020
1 parent ca7e3ed commit 3a13f98
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 @@ -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;
Expand Down

0 comments on commit 3a13f98

Please sign in to comment.