]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
sysfs: Use PTR_ERR_OR_ZERO()
authorVasyl Gomonovych <gomonovych@gmail.com>
Mon, 27 Nov 2017 23:10:32 +0000 (00:10 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Dec 2017 15:47:27 +0000 (16:47 +0100)
Fix ptr_ret.cocci warnings:
fs/sysfs/group.c:409:8-14: 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

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/group.c

index ac2de0ed69adfc52db87dbd89391c030179e45c1..3f8efe8f387b5436bf261b42c59a76b9e19629e3 100644 (file)
@@ -406,6 +406,6 @@ int __compat_only_sysfs_link_entry_to_kobj(struct kobject *kobj,
 
        kernfs_put(entry);
        kernfs_put(target);
-       return IS_ERR(link) ? PTR_ERR(link) : 0;
+       return PTR_ERR_OR_ZERO(link);
 }
 EXPORT_SYMBOL_GPL(__compat_only_sysfs_link_entry_to_kobj);