From: Fengguang Wu Date: Mon, 5 Feb 2018 16:25:16 +0000 (+0800) Subject: ovl: fix ptr_ret.cocci warnings X-Git-Tag: v4.16-rc5~23^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5095f24e791c2d05da7cbb3d99e2b420b36a273;p=thirdparty%2Flinux.git ovl: fix ptr_ret.cocci warnings 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 Signed-off-by: Fengguang Wu Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c index 97a916ea8b86a..87bd4148f4fb5 100644 --- a/fs/overlayfs/export.c +++ b/fs/overlayfs/export.c @@ -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);