diff mbox

[26/39] dmaengine: drop null test before destroy functions

Message ID 1442146532-9100-27-git-send-email-Julia.Lawall@lip6.fr (mailing list archive)
State Accepted
Headers show

Commit Message

Julia Lawall Sept. 13, 2015, 12:15 p.m. UTC
Remove unneeded NULL test.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@ expression x; @@
-if (x != NULL)
  \(kmem_cache_destroy\|mempool_destroy\|dma_pool_destroy\)(x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/dma/dmaengine.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Vinod Koul Sept. 21, 2015, 5:10 p.m. UTC | #1
On Sun, Sep 13, 2015 at 02:15:19PM +0200, Julia Lawall wrote:
> Remove unneeded NULL test.
> 

Applied, thanks
diff mbox

Patch

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 3ff284c..45df9a4 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -1066,11 +1066,9 @@  static void dmaengine_destroy_unmap_pool(void)
 	for (i = 0; i < ARRAY_SIZE(unmap_pool); i++) {
 		struct dmaengine_unmap_pool *p = &unmap_pool[i];
 
-		if (p->pool)
-			mempool_destroy(p->pool);
+		mempool_destroy(p->pool);
 		p->pool = NULL;
-		if (p->cache)
-			kmem_cache_destroy(p->cache);
+		kmem_cache_destroy(p->cache);
 		p->cache = NULL;
 	}
 }