005ea6e51e4e3f820c5f007211cd9206b03c60bd
[oweals/openwrt.git] / target / linux / mvebu / patches-4.19 / 534-net-mvneta-remove-redundant-check-for.patch
1 From e4a3e9ff5ba9f6b67595ec2768ed4be2054c2aa5 Mon Sep 17 00:00:00 2001
2 From: YueHaibing <yuehaibing@huawei.com>
3 Date: Thu, 22 Nov 2018 14:42:00 +0800
4 Subject: [PATCH] net: mvneta: remove redundant check for
5  eee->tx_lpi_timer < 0
6
7 fixes the smatch warning:
8
9 drivers/net/ethernet/marvell/mvneta.c:4252 mvneta_ethtool_set_eee() warn:
10  unsigned 'eee->tx_lpi_timer' is never less than zero.
11
12 Signed-off-by: YueHaibing <yuehaibing@huawei.com>
13 Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
14 Signed-off-by: David S. Miller <davem@davemloft.net>
15 ---
16  drivers/net/ethernet/marvell/mvneta.c | 3 +--
17  1 file changed, 1 insertion(+), 2 deletions(-)
18
19 --- a/drivers/net/ethernet/marvell/mvneta.c
20 +++ b/drivers/net/ethernet/marvell/mvneta.c
21 @@ -4253,8 +4253,7 @@ static int mvneta_ethtool_set_eee(struct
22  
23         /* The Armada 37x documents do not give limits for this other than
24          * it being an 8-bit register. */
25 -       if (eee->tx_lpi_enabled &&
26 -           (eee->tx_lpi_timer < 0 || eee->tx_lpi_timer > 255))
27 +       if (eee->tx_lpi_enabled && eee->tx_lpi_timer > 255)
28                 return -EINVAL;
29  
30         lpi_ctl0 = mvreg_read(pp, MVNETA_LPI_CTRL_0);