Skip to content

Commit

Permalink
net: mvneta: remove redundant check for eee->tx_lpi_timer < 0
Browse files Browse the repository at this point in the history
fixes the smatch warning:

drivers/net/ethernet/marvell/mvneta.c:4252 mvneta_ethtool_set_eee() warn:
 unsigned 'eee->tx_lpi_timer' is never less than zero.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YueHaibing authored and David S. Miller committed Nov 24, 2018
1 parent 9af8009 commit e4a3e9f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/marvell/mvneta.c
Original file line number Diff line number Diff line change
Expand Up @@ -4248,8 +4248,7 @@ static int mvneta_ethtool_set_eee(struct net_device *dev,

/* The Armada 37x documents do not give limits for this other than
* it being an 8-bit register. */
if (eee->tx_lpi_enabled &&
(eee->tx_lpi_timer < 0 || eee->tx_lpi_timer > 255))
if (eee->tx_lpi_enabled && eee->tx_lpi_timer > 255)
return -EINVAL;

lpi_ctl0 = mvreg_read(pp, MVNETA_LPI_CTRL_0);
Expand Down

0 comments on commit e4a3e9f

Please sign in to comment.