dmaengine: drop null test before destroy functions
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 13 Sep 2015 12:15:19 +0000 (14:15 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 21 Sep 2015 17:10:07 +0000 (22:40 +0530)
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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/dmaengine.c

index 3ff284c8e3d5aef72f229017c883c73cbe13403f..45df9a47c891075ed659dcb93cde6e578c7f486d 100644 (file)
@@ -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;
        }
 }
This page took 0.028365 seconds and 5 git commands to generate.