diff options
author | Yan Markman <ymarkman@marvell.com> | 2018-05-17 10:34:25 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-05-17 16:18:54 -0400 |
commit | 914365f1c97d3aa1881fd6fc477c4799a39c00f9 (patch) | |
tree | d8f95af040683edddffe69d3650b391262dfa86c /drivers/net/ethernet/marvell/mvpp2.c | |
parent | 808e2fc3b0972c0009846e4c016adb68c765fed0 (diff) | |
download | linux-914365f1c97d3aa1881fd6fc477c4799a39c00f9.tar.bz2 |
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>
Diffstat (limited to 'drivers/net/ethernet/marvell/mvpp2.c')
-rw-r--r-- | drivers/net/ethernet/marvell/mvpp2.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index 5e580482769e..de664b3f45f2 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c @@ -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; } |