net: phy: realtek: net: Fix less than zero comparison of a u16
authorColin Ian King <colin.king@canonical.com>
Wed, 9 Jun 2021 17:17:48 +0000 (18:17 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 9 Jun 2021 22:32:08 +0000 (15:32 -0700)
commitf25247d88708ff0666573541923a7339845403de
tree63b57b71ca26fa1421f103862b2aa91f159f2363
parent345502af4e42cef57782118520c3c326b55f1071
net: phy: realtek: net: Fix less than zero comparison of a u16

The comparisons of the u16 values priv->phycr1 and priv->phycr2 to less
than zero always false because they are unsigned. Fix this by using an
int for the assignment and less than zero check.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 0a4355c2b7f8 ("net: phy: realtek: add dt property to disable CLKOUT clock")
Fixes: d90db36a9e74 ("net: phy: realtek: add dt property to enable ALDPS mode")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/realtek.c