mirror of https://gitee.com/openkylin/linux.git
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
|
@ -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 New Issue