]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
dm: drop NULL test before kmem_cache_destroy() and mempool_destroy()
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sun, 13 Sep 2015 12:15:05 +0000 (14:15 +0200)
committerMike Snitzer <snitzer@redhat.com>
Sat, 31 Oct 2015 23:06:00 +0000 (19:06 -0400)
commit6f65985e2636c0b170eade6a72d216632f065e26
tree2f055892081b955b52b037db6628dd7e9c08b293
parent71cdb6978a80f9f6c51bef0622388c1414c2fe32
dm: drop NULL test before kmem_cache_destroy() and mempool_destroy()

Remove DM's unneeded NULL tests before calling these destroy functions,
now that they check for NULL, thanks to these v4.3 commits:
3942d2991 ("mm/slab_common: allow NULL cache pointer in kmem_cache_destroy()")
4e3ca3e03 ("mm/mempool: allow NULL `pool' pointer in mempool_destroy()")

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: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-bufio.c
drivers/md/dm-cache-target.c
drivers/md/dm-crypt.c
drivers/md/dm-io.c
drivers/md/dm-log-userspace-base.c
drivers/md/dm-region-hash.c
drivers/md/dm.c