sh: Delete unnecessary checks before the function call "mempool_destroy"
authorMarkus Elfring <elfring@users.sourceforge.net>
Mon, 16 Nov 2015 07:20:36 +0000 (08:20 +0100)
committerRich Felker <dalias@libc.org>
Fri, 5 Aug 2016 03:29:42 +0000 (03:29 +0000)
The mempool_destroy() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Rich Felker <dalias@libc.org>
arch/sh/kernel/dwarf.c

index 9d209a07235eaeda7154b170b19b04c395d4b11b..e1d751ae2498af3a2dd00b9f4fe8c5f4935065fe 100644 (file)
@@ -1009,10 +1009,8 @@ static void __init dwarf_unwinder_cleanup(void)
        rbtree_postorder_for_each_entry_safe(cie, next_cie, &cie_root, node)
                kfree(cie);
 
-       if (dwarf_reg_pool)
-               mempool_destroy(dwarf_reg_pool);
-       if (dwarf_frame_pool)
-               mempool_destroy(dwarf_frame_pool);
+       mempool_destroy(dwarf_reg_pool);
+       mempool_destroy(dwarf_frame_pool);
        kmem_cache_destroy(dwarf_reg_cachep);
        kmem_cache_destroy(dwarf_frame_cachep);
 }