Skip to content

Commit

Permalink
nilfs2: drop null test before destroy functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ryusuke Konishi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
JuliaLawall authored and torvalds committed Nov 7, 2015
1 parent 6d32f7a commit da80a39
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions fs/nilfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1405,14 +1405,10 @@ static void nilfs_destroy_cachep(void)
*/
rcu_barrier();

if (nilfs_inode_cachep)
kmem_cache_destroy(nilfs_inode_cachep);
if (nilfs_transaction_cachep)
kmem_cache_destroy(nilfs_transaction_cachep);
if (nilfs_segbuf_cachep)
kmem_cache_destroy(nilfs_segbuf_cachep);
if (nilfs_btree_path_cache)
kmem_cache_destroy(nilfs_btree_path_cache);
kmem_cache_destroy(nilfs_inode_cachep);
kmem_cache_destroy(nilfs_transaction_cachep);
kmem_cache_destroy(nilfs_segbuf_cachep);
kmem_cache_destroy(nilfs_btree_path_cache);
}

static int __init nilfs_init_cachep(void)
Expand Down

0 comments on commit da80a39

Please sign in to comment.