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 <[email protected]>
---
drivers/net/ethernet/marvell/mvneta.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index e5397c8..46a0f6b 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -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);
--
2.7.0
Hello,
On Thu, 22 Nov 2018 14:42:00 +0800, YueHaibing wrote:
> 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 <[email protected]>
Acked-by: Thomas Petazzoni <[email protected]>
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
From: YueHaibing <[email protected]>
Date: Thu, 22 Nov 2018 14:42:00 +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 <[email protected]>
Applied.