]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
cgroup: fix coccinelle warnings
authorFengguang Wu <fengguang.wu@intel.com>
Thu, 13 Feb 2014 21:42:43 +0000 (16:42 -0500)
committerTejun Heo <tj@kernel.org>
Thu, 13 Feb 2014 21:42:45 +0000 (16:42 -0500)
kernel/cgroup.c:2256:1-3: WARNING: PTR_RET can be used

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

Generated by: coccinelle/api/ptr_ret.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup.c

index 750d0e1e7e56405ca47fc338f73ac8acd6bd5cea..15dcae74b51061028cfffdc1eb63ebdd3d964733 100644 (file)
@@ -2171,9 +2171,7 @@ static int cgroup_add_file(struct cgroup *cgrp, struct cftype *cft)
        kn = __kernfs_create_file(cgrp->kn, cgroup_file_name(cgrp, cft, name),
                                  cgroup_file_mode(cft), 0, cft->kf_ops, cft,
                                  NULL, false, key);
-       if (IS_ERR(kn))
-               return PTR_ERR(kn);
-       return 0;
+       return PTR_ERR_OR_ZERO(kn);
 }
 
 /**