ANDROID: sdcardfs: fix itnull.cocci warnings
authorJulia Lawall <julia.lawall@lip6.fr>
Wed, 1 Jun 2016 17:28:49 +0000 (10:28 -0700)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:16 +0000 (18:03 +0200)
List_for_each_entry has the property that the first argument is always
bound to a real list element, never NULL, so testing dentry is not needed.

Generated by: scripts/coccinelle/iterators/itnull.cocci

Change-Id: I51033a2649eb39451862b35b6358fe5cfe25c5f5
Cc: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Guenter Roeck <groeck@chromium.org>
fs/sdcardfs/derived_perm.c

index 9de45bc54f0eb1a77ff630a68252881e222127a3..903e89068170f3adaa16b396f9d7777f5caad25c 100644 (file)
@@ -112,7 +112,7 @@ void get_derived_permission(struct dentry *parent, struct dentry *dentry)
 void get_derive_permissions_recursive(struct dentry *parent) {
        struct dentry *dentry;
        list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) {
-               if (dentry && dentry->d_inode) {
+               if (dentry->d_inode) {
                        mutex_lock(&dentry->d_inode->i_mutex);
                        get_derived_permission(parent, dentry);
                        fix_derived_permission(dentry->d_inode);