net: mvneta: remove redundant check for eee->tx_lpi_timer < 0
authorYueHaibing <yuehaibing@huawei.com>
Thu, 22 Nov 2018 06:42:00 +0000 (14:42 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Nov 2018 01:17:09 +0000 (17:17 -0800)
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>
drivers/net/ethernet/marvell/mvneta.c

index e5397c8197b9c3713c48e925dad0dfcee732c0b9..46a0f6b45d8495730189de1656e093099e5240c4 100644 (file)
@@ -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);