]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
cgroup: remove unneeded checks
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 9 Aug 2017 10:25:21 +0000 (13:25 +0300)
committerTejun Heo <tj@kernel.org>
Fri, 11 Aug 2017 17:33:28 +0000 (10:33 -0700)
"descendants" and "depth" are declared as int, so they can't be larger
than INT_MAX.  Static checkers complain and it's slightly confusing for
humans as well so let's just remove these conditions.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
kernel/cgroup/cgroup.c

index c038ccf95b5dd5d53e2f6c0b7ffccd59da9e891f..1591e9b20122e762ffebf2b0b97c5f6eb95790a8 100644 (file)
@@ -3223,7 +3223,7 @@ static ssize_t cgroup_max_descendants_write(struct kernfs_open_file *of,
                        return ret;
        }
 
-       if (descendants < 0 || descendants > INT_MAX)
+       if (descendants < 0)
                return -ERANGE;
 
        cgrp = cgroup_kn_lock_live(of->kn, false);
@@ -3266,7 +3266,7 @@ static ssize_t cgroup_max_depth_write(struct kernfs_open_file *of,
                        return ret;
        }
 
-       if (depth < 0 || depth > INT_MAX)
+       if (depth < 0)
                return -ERANGE;
 
        cgrp = cgroup_kn_lock_live(of->kn, false);