mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 05:48:40 +00:00
net: mvpp2: avoid checking for free aggregated descriptors twice
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> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
808e2fc3b0
commit
914365f1c9
1 changed files with 3 additions and 4 deletions
|
@ -5487,11 +5487,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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue