Skip to content

Commit e1305df

Browse files
JuliaLawallcomputersforpeace
authored andcommitted
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>
1 parent 0791a5f commit e1305df

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

‎fs/jffs2/malloc.c‎

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,25 +97,16 @@ int __init jffs2_create_slab_caches(void)
9797

9898
void jffs2_destroy_slab_caches(void)
9999
{
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);
114107
#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);
119110
#endif
120111
}
121112

0 commit comments

Comments
 (0)