All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice
@ 2018-02-26 14:14 Antoine Tenart
  2018-02-26 14:14 ` [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds Antoine Tenart
  2018-02-26 14:14 ` [PATCH net-next 3/3] net: mvpp2: align the ethtool ops definition Antoine Tenart
  0 siblings, 2 replies; 6+ messages in thread
From: Antoine Tenart @ 2018-02-26 14:14 UTC (permalink / raw)
  To: davem
  Cc: Yan Markman, mw, stefanc, thomas.petazzoni, gregory.clement,
	miquel.raynal, nadavh, maxime.chevallier, netdev, linux-kernel,
	Antoine Tenart

From: Yan Markman <ymarkman@marvell.com>

Avoid repeating the check for free aggregated descriptors when it
already failed at the beginning of the function.

Signed-off-by: Yan Markman <ymarkman@marvell.com>
[Antoine: commit message]
Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 5a1668cdb461..55300b1fe6c0 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5224,11 +5224,10 @@ static int mvpp2_aggr_desc_num_check(struct mvpp2 *priv,
 		u32 val = mvpp2_read(priv, MVPP2_AGGR_TXQ_STATUS_REG(cpu));
 
 		aggr_txq->count = val & MVPP2_AGGR_TXQ_PENDING_MASK;
-	}
-
-	if ((aggr_txq->count + num) > MVPP2_AGGR_TXQ_SIZE)
-		return -ENOMEM;
 
+		if ((aggr_txq->count + num) > MVPP2_AGGR_TXQ_SIZE)
+			return -ENOMEM;
+	}
 	return 0;
 }
 
-- 
2.14.3

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

end of thread, other threads:[~2018-02-27 17:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-26 14:14 [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice Antoine Tenart
2018-02-26 14:14 ` [PATCH net-next 2/3] net: mvpp2: adjust gso stop wake thresholds Antoine Tenart
2018-02-27 16:13   ` David Miller
2018-02-27 17:13     ` Antoine Tenart
2018-02-27 17:48       ` Yan Markman
2018-02-26 14:14 ` [PATCH net-next 3/3] net: mvpp2: align the ethtool ops definition Antoine Tenart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.