cgroup: remove unneeded checks

"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>
This commit is contained in:
Dan Carpenter 2017-08-09 13:25:21 +03:00 committed by Tejun Heo
parent 3e48930cc7
commit 696b98f244

View 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);