net: ethernet: ti: remove redundant NULL check.
authorCyril Roelandt <tipecaml@gmail.com>
Tue, 12 Feb 2013 12:52:30 +0000 (12:52 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Feb 2013 18:41:44 +0000 (13:41 -0500)
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in
cpdma_ctlr_destroy() can safely be removed.

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/davinci_cpdma.c

index 198cf18..7d3bffd 100644 (file)
@@ -460,10 +460,8 @@ int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)
        if (ctlr->state != CPDMA_STATE_IDLE)
                cpdma_ctlr_stop(ctlr);
 
-       for (i = 0; i < ARRAY_SIZE(ctlr->channels); i++) {
-               if (ctlr->channels[i])
-                       cpdma_chan_destroy(ctlr->channels[i]);
-       }
+       for (i = 0; i < ARRAY_SIZE(ctlr->channels); i++)
+               cpdma_chan_destroy(ctlr->channels[i]);
 
        cpdma_desc_pool_destroy(ctlr->pool);
        spin_unlock_irqrestore(&ctlr->lock, flags);