linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0
@ 2018-11-22  6:42 YueHaibing
  2018-11-22  7:44 ` Thomas Petazzoni
  2018-11-24  1:17 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-11-22  6:42 UTC (permalink / raw)
  To: davem, thomas.petazzoni; +Cc: linux-kernel, netdev, YueHaibing

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>
---
 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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0
  2018-11-22  6:42 [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0 YueHaibing
@ 2018-11-22  7:44 ` Thomas Petazzoni
  2018-11-24  1:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-11-22  7:44 UTC (permalink / raw)
  To: YueHaibing; +Cc: davem, linux-kernel, netdev

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 <yuehaibing@huawei.com>

Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0
  2018-11-22  6:42 [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0 YueHaibing
  2018-11-22  7:44 ` Thomas Petazzoni
@ 2018-11-24  1:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-11-24  1:17 UTC (permalink / raw)
  To: yuehaibing; +Cc: thomas.petazzoni, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
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 <yuehaibing@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-11-24  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-22  6:42 [PATCH net-next] net: mvneta: remove redundant check for eee->tx_lpi_timer < 0 YueHaibing
2018-11-22  7:44 ` Thomas Petazzoni
2018-11-24  1:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).