From: Dan Carpenter <dan.carpenter@oracle.com>
To: Tejun Heo <tj@kernel.org>, Roman Gushchin <guro@fb.com>
Cc: Zefan Li <lizefan@huawei.com>,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH] cgroup: remove unneeded checks
Date: Wed, 9 Aug 2017 13:25:21 +0300 [thread overview]
Message-ID: <20170809102521.pizo5vlqhb5unrin@mwanda> (raw)
"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>
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);
next reply other threads:[~2017-08-09 10:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 10:25 Dan Carpenter [this message]
2017-08-11 17:33 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170809102521.pizo5vlqhb5unrin@mwanda \
--to=dan.carpenter@oracle.com \
--cc=guro@fb.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®