Re: [PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice

2018-05-17 Thread David Miller
From: Antoine Tenart 
Date: Thu, 17 May 2018 10:34:25 +0200

> From: Yan Markman 
> 
> Avoid repeating the check for free aggregated descriptors when it
> already failed at the beginning of the function.
> 
> Signed-off-by: Yan Markman 
> [Antoine: commit message]
> Signed-off-by: Antoine Tenart 

Applied.


[PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice

2018-05-17 Thread Antoine Tenart
From: Yan Markman 

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

Signed-off-by: Yan Markman 
[Antoine: commit message]
Signed-off-by: Antoine Tenart 
---
 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 df59f0e0d33c..73b2f2d331c5 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5488,11 +5488,10 @@ static int mvpp2_aggr_desc_num_check(struct mvpp2 *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.17.0



[PATCH net-next 1/3] net: mvpp2: avoid checking for free aggregated descriptors twice

2018-02-26 Thread Antoine Tenart
From: Yan Markman 

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

Signed-off-by: Yan Markman 
[Antoine: commit message]
Signed-off-by: Antoine Tenart 
---
 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