net: ethernet: ti: remove redundant NULL check.
PATCH 1/1 net: ethernet: ti: remove redundant NULL check.
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed.
--- drivers/net/ethernet/ti/davinci_cpdma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/ti/davinci_cpdma.c +1 -2
@@ -450,8 +450,7 @@ int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)cpdma_ctlr_stop (ctlr);for (i =0 ; i <ARRAY_SIZE (ctlr->channels); i++) { -if (ctlr->channels[i]) -cpdma_chan_destroy (ctlr->channels[i]); +cpdma_chan_destroy (ctlr->channels[i]); }cpdma_desc_pool_destroy (ctlr->pool);
Signature · 1 line
1.7.10.4
David Miller
maintainerFrom: Cyril Roelandt <[email protected]>
Date: Tue, 12 Feb 2013 22:54:46 +0100
Quoted 4 lines
cpdma_chan_destroy()on a NULL pointer is a no-op, so the NULL check incpdma_ctlr_destroy()can safely be removed.Signed-off-by Cyril Roelandt <[email protected]>
...
drivers/net/ethernet/ti/davinci_cpdma.c int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr) · line 454
Quoted 8 lines
drivers/net/ethernet/ti/davinci_cpdma.c +1
-2@@ -450,8 +450,7 @@ int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)cpdma_ctlr_stop (ctlr);for (i =0 ; i <ARRAY_SIZE (ctlr->channels); i++) { -if (ctlr->channels[i]) -cpdma_chan_destroy (ctlr->channels[i]); +cpdma_chan_destroy (ctlr->channels[i]); }
SInce this is now a single statement basic block, remove the surrounding braces.
PATCH 1/1 net: ethernet: ti: remove redundant NULL check.
cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in cpdma_ctlr_destroy() can safely be removed.
--- drivers/net/ethernet/ti/davinci_cpdma.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/ethernet/ti/davinci_cpdma.c +2 -4
@@ -449,10 +449,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);
Signature · 1 line
1.7.10.4
From: Cyril Roelandt <[email protected]>
Date: Tue, 12 Feb 2013 23:52:30 +0100
Quoted 4 lines
cpdma_chan_destroy()on a NULL pointer is a no-op, so the NULL check incpdma_ctlr_destroy()can safely be removed.Signed-off-by Cyril Roelandt <[email protected]>
Applied, thanks.
Quoted 11 lines · David Miller
From: Cyril Roelandt<[email protected]>
Date: Tue, 12 Feb 2013 22:54:46 +0100Quoted 4 lines
cpdma_chan_destroy()on a NULL pointer is a no-op, so the NULL check incpdma_ctlr_destroy()can safely be removed.Signed-off-by Cyril Roelandt<[email protected]>...
Quoted 3 lines
drivers/net/ethernet/ti/davinci_cpdma.c +0
-0@@ -450,8 +450,7 @@ int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr)cpdma_ctlr_stop (ctlr);
Quoted 8 lines
drivers/net/ethernet/ti/davinci_cpdma.c int cpdma_ctlr_destroy(struct cpdma_ctlr *ctlr) · line 454
Quoted 5 lines
drivers/net/ethernet/ti/davinci_cpdma.c +1
-2for (i =0 ; i<ARRAY_SIZE (ctlr->channels); i++) { -if (ctlr->channels[i]) -cpdma_chan_destroy (ctlr->channels[i]); +cpdma_chan_destroy (ctlr->channels[i]); }SInce this is now a single statement basic block, remove the surrounding braces.
Ok, I resent, though I forgot to add "v2".
Regards,
Cyril Roelandt.
David Miller
maintainerFrom: Cyril Roelandt <[email protected]>
Date: Tue, 12 Feb 2013 23:54:41 +0100
Quoted 1 line
Ok, I resent, though I forgot to add "v2".
Don't worry about that.