]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net: mvpp2: avoid checking for free aggregated descriptors twice
authorYan Markman <ymarkman@marvell.com>
Thu, 17 May 2018 08:34:25 +0000 (10:34 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 17 May 2018 20:18:54 +0000 (16:18 -0400)
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>
drivers/net/ethernet/marvell/mvpp2.c

index 5e580482769ebd0394a95dfb2534985598d92f9c..de664b3f45f2dbf68849aefb2bbc7f32096ed436 100644 (file)
@@ -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;
 }