Skip to content

Commit

Permalink
cgroup: remove unneeded checks
Browse files Browse the repository at this point in the history
"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>
  • Loading branch information
Dan Carpenter authored and Tejun Heo committed Aug 11, 2017
1 parent 3e48930 commit 696b98f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/cgroup/cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 696b98f

Please sign in to comment.