From: Yan Markman Date: Thu, 17 May 2018 08:34:25 +0000 (+0200) Subject: net: mvpp2: avoid checking for free aggregated descriptors twice X-Git-Tag: v4.19~872^2~215^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=914365f1c97d3aa1881fd6fc477c4799a39c00f9;p=platform%2Fkernel%2Flinux-rpi.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 [Antoine: commit message] Signed-off-by: Antoine Tenart Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index 5e58048..de664b3 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; }