[PATCH] cgroup: remove unneeded checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"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@xxxxxxxxxx>

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index bf8a6e2db278..5988781d7128 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3247,7 +3247,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);
@@ -3290,7 +3290,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);
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux