ANDROID: sdcardfs: remove unneeded null check
authorDaniel Rosenberg <drosen@google.com>
Tue, 21 Mar 2017 23:29:13 +0000 (16:29 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 10 Apr 2017 07:42:16 +0000 (13:12 +0530)
As pointed out by checkpatch, these functions already
handle null inputs, so the checks are not needed.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35331000
Change-Id: I189342f032dfcefee36b27648bb512488ad61d20

fs/sdcardfs/lookup.c
fs/sdcardfs/packagelist.c
fs/sdcardfs/super.c

index fab9fd9d01055e814bced15f55da3aee7f25c84d..51a904e59f467e9efd246a7a071676ffc13345f9 100644 (file)
@@ -36,8 +36,7 @@ int sdcardfs_init_dentry_cache(void)
 
 void sdcardfs_destroy_dentry_cache(void)
 {
-       if (sdcardfs_dentry_cachep)
-               kmem_cache_destroy(sdcardfs_dentry_cachep);
+       kmem_cache_destroy(sdcardfs_dentry_cachep);
 }
 
 void free_dentry_private_data(struct dentry *dentry)
index 58218fed4083d82b662b3cc82bd5b65447e71e66..3c016cb0d8bb3f37141a8b434fb5a7d9cba4e5b3 100644 (file)
@@ -889,6 +889,5 @@ void packagelist_exit(void)
 {
        configfs_sdcardfs_exit();
        packagelist_destroy();
-       if (hashtable_entry_cachep)
-               kmem_cache_destroy(hashtable_entry_cachep);
+       kmem_cache_destroy(hashtable_entry_cachep);
 }
index a4629f20812e66121e6762c847092b8ed23cd60b..7d3c331379f59c68779ed9207a1afe479b25faf1 100644 (file)
@@ -222,8 +222,7 @@ int sdcardfs_init_inode_cache(void)
 /* sdcardfs inode cache destructor */
 void sdcardfs_destroy_inode_cache(void)
 {
-       if (sdcardfs_inode_cachep)
-               kmem_cache_destroy(sdcardfs_inode_cachep);
+       kmem_cache_destroy(sdcardfs_inode_cachep);
 }
 
 /*