1
0
Fork 0

dmaengine: drop null test before destroy functions

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>
steinar/wifi_calib_4_9_kernel
Julia Lawall 2015-09-13 14:15:19 +02:00 committed by Vinod Koul
parent 9c811209eb
commit 240eb91607
1 changed files with 2 additions and 4 deletions

View 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;
}
}