]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ovl: fix ptr_ret.cocci warnings
authorFengguang Wu <fengguang.wu@intel.com>
Mon, 5 Feb 2018 16:25:16 +0000 (00:25 +0800)
committerMiklos Szeredi <mszeredi@redhat.com>
Mon, 26 Feb 2018 11:45:20 +0000 (12:45 +0100)
fs/overlayfs/export.c:459:10-16: WARNING: PTR_ERR_OR_ZERO can be used

 Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Fixes: 4b91c30a5a19 ("ovl: lookup connected ancestor of dir in inode cache")
CC: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/overlayfs/export.c

index 97a916ea8b86ab89390ec1fe6dd25043d74e8212..87bd4148f4fb5811547fa2b44a7965af7f22e52a 100644 (file)
@@ -620,7 +620,7 @@ static struct dentry *ovl_lookup_real(struct super_block *sb,
                        if (err == -ECHILD) {
                                this = ovl_lookup_real_ancestor(sb, real,
                                                                layer);
-                               err = IS_ERR(this) ? PTR_ERR(this) : 0;
+                               err = PTR_ERR_OR_ZERO(this);
                        }
                        if (!err) {
                                dput(connected);