From: Daniel Walker <dwalker@fifo99.com>
To: Tejun Heo <tj@kernel.org>, Li Zefan <lizefan@huawei.com>
Cc: containers@lists.linux-foundation.org, cgroups@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] cgroups: remove calls to simple_kstrtoll
Date: Fri, 25 Oct 2013 19:33:13 -0700 [thread overview]
Message-ID: <1382754793-8827-3-git-send-email-dwalker@fifo99.com> (raw)
Signed-off-by: Daniel Walker <dwalker@fifo99.com>
---
kernel/cgroup.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 41f71c3..bf8b891 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2276,7 +2276,7 @@ static ssize_t cgroup_write_X64(struct cgroup_subsys_state *css,
{
char buffer[CGROUP_LOCAL_BUFFER_SIZE];
int retval = 0;
- char *end;
+ int ret;
if (!nbytes)
return -EINVAL;
@@ -2287,13 +2287,15 @@ static ssize_t cgroup_write_X64(struct cgroup_subsys_state *css,
buffer[nbytes] = 0; /* nul-terminate */
if (cft->write_u64) {
- u64 val = simple_strtoull(strstrip(buffer), &end, 0);
- if (*end)
+ u64 val;
+ ret = kstrtoull(strstrip(buffer), 0, &val);
+ if (ret != 0)
return -EINVAL;
retval = cft->write_u64(css, cft, val);
} else {
- s64 val = simple_strtoll(strstrip(buffer), &end, 0);
- if (*end)
+ s64 val;
+ ret = kstrtoll(strstrip(buffer), 0, &val);
+ if (ret != 0)
return -EINVAL;
retval = cft->write_s64(css, cft, val);
}
--
1.8.3.2
next reply other threads:[~2013-10-26 2:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-26 2:33 Daniel Walker [this message]
2013-10-27 11:39 ` Tejun Heo
2013-10-27 15:12 ` Daniel Walker
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=1382754793-8827-3-git-send-email-dwalker@fifo99.com \
--to=dwalker@fifo99.com \
--cc=cgroups@vger.kernel.org \
--cc=containers@lists.linux-foundation.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®