Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jffs2: 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: Brian Norris <computersforpeace@gmail.com>

authored by

Julia Lawall and committed by
Brian Norris
e1305df1 0791a5f8

+9 -18
+9 -18
fs/jffs2/malloc.c
··· 97 97 98 98 void jffs2_destroy_slab_caches(void) 99 99 { 100 - if(full_dnode_slab) 101 - kmem_cache_destroy(full_dnode_slab); 102 - if(raw_dirent_slab) 103 - kmem_cache_destroy(raw_dirent_slab); 104 - if(raw_inode_slab) 105 - kmem_cache_destroy(raw_inode_slab); 106 - if(tmp_dnode_info_slab) 107 - kmem_cache_destroy(tmp_dnode_info_slab); 108 - if(raw_node_ref_slab) 109 - kmem_cache_destroy(raw_node_ref_slab); 110 - if(node_frag_slab) 111 - kmem_cache_destroy(node_frag_slab); 112 - if(inode_cache_slab) 113 - kmem_cache_destroy(inode_cache_slab); 100 + kmem_cache_destroy(full_dnode_slab); 101 + kmem_cache_destroy(raw_dirent_slab); 102 + kmem_cache_destroy(raw_inode_slab); 103 + kmem_cache_destroy(tmp_dnode_info_slab); 104 + kmem_cache_destroy(raw_node_ref_slab); 105 + kmem_cache_destroy(node_frag_slab); 106 + kmem_cache_destroy(inode_cache_slab); 114 107 #ifdef CONFIG_JFFS2_FS_XATTR 115 - if (xattr_datum_cache) 116 - kmem_cache_destroy(xattr_datum_cache); 117 - if (xattr_ref_cache) 118 - kmem_cache_destroy(xattr_ref_cache); 108 + kmem_cache_destroy(xattr_datum_cache); 109 + kmem_cache_destroy(xattr_ref_cache); 119 110 #endif 120 111 } 121 112