Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 240eb916 authored by Julia Lawall's avatar Julia Lawall Committed by Vinod Koul
Browse files

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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 9c811209
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -1066,10 +1066,8 @@ static void dmaengine_destroy_unmap_pool(void)
	for (i = 0; i < ARRAY_SIZE(unmap_pool); i++) {
	for (i = 0; i < ARRAY_SIZE(unmap_pool); i++) {
		struct dmaengine_unmap_pool *p = &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;
		p->pool = NULL;
		if (p->cache)
		kmem_cache_destroy(p->cache);
		kmem_cache_destroy(p->cache);
		p->cache = NULL;
		p->cache = NULL;
	}
	}