* [PATCH 3/3] cgroups: remove calls to simple_kstrtoll
@ 2013-10-26 2:33 Daniel Walker
[not found] ` <1382754793-8827-3-git-send-email-dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Walker @ 2013-10-26 2:33 UTC (permalink / raw)
To: Tejun Heo, Li Zefan; +Cc: containers, cgroups, linux-kernel
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
^ permalink raw reply related [flat|nested] 7+ messages in thread[parent not found: <1382754793-8827-3-git-send-email-dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org>]
* Re: [PATCH 3/3] cgroups: remove calls to simple_kstrtoll 2013-10-26 2:33 [PATCH 3/3] cgroups: remove calls to simple_kstrtoll Daniel Walker @ 2013-10-27 11:39 ` Tejun Heo 0 siblings, 0 replies; 7+ messages in thread From: Tejun Heo @ 2013-10-27 11:39 UTC (permalink / raw) To: Daniel Walker Cc: Li Zefan, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, cgroups-u79uwXL29TY76Z2rM5mHXA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Fri, Oct 25, 2013 at 07:33:13PM -0700, Daniel Walker wrote: > Signed-off-by: Daniel Walker <dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org> Can you please briefly explain why this conversion is happening in the patch description? Thanks. -- tejun ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] cgroups: remove calls to simple_kstrtoll @ 2013-10-27 11:39 ` Tejun Heo 0 siblings, 0 replies; 7+ messages in thread From: Tejun Heo @ 2013-10-27 11:39 UTC (permalink / raw) To: Daniel Walker; +Cc: Li Zefan, containers, cgroups, linux-kernel On Fri, Oct 25, 2013 at 07:33:13PM -0700, Daniel Walker wrote: > Signed-off-by: Daniel Walker <dwalker@fifo99.com> Can you please briefly explain why this conversion is happening in the patch description? Thanks. -- tejun ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <20131027113925.GF14934-9pTldWuhBndy/B6EtB590w@public.gmane.org>]
* Re: [PATCH 3/3] cgroups: remove calls to simple_kstrtoll 2013-10-27 11:39 ` Tejun Heo @ 2013-10-27 15:12 ` Daniel Walker -1 siblings, 0 replies; 7+ messages in thread From: Daniel Walker @ 2013-10-27 15:12 UTC (permalink / raw) To: Tejun Heo Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Sure , I can add it .. It's because simple_strtoll is obsolete .. On Sun, Oct 27, 2013 at 07:39:25AM -0400, Tejun Heo wrote: > On Fri, Oct 25, 2013 at 07:33:13PM -0700, Daniel Walker wrote: > > Signed-off-by: Daniel Walker <dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org> > > Can you please briefly explain why this conversion is happening in the > patch description? > > Thanks. > > -- > tejun > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] cgroups: remove calls to simple_kstrtoll @ 2013-10-27 15:12 ` Daniel Walker 0 siblings, 0 replies; 7+ messages in thread From: Daniel Walker @ 2013-10-27 15:12 UTC (permalink / raw) To: Tejun Heo; +Cc: Li Zefan, containers, cgroups, linux-kernel Sure , I can add it .. It's because simple_strtoll is obsolete .. On Sun, Oct 27, 2013 at 07:39:25AM -0400, Tejun Heo wrote: > On Fri, Oct 25, 2013 at 07:33:13PM -0700, Daniel Walker wrote: > > Signed-off-by: Daniel Walker <dwalker@fifo99.com> > > Can you please briefly explain why this conversion is happening in the > patch description? > > Thanks. > > -- > tejun > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] cgroups: remove calls to simple_kstrtoll [not found] ` <1382754793-8827-3-git-send-email-dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org> 2013-10-27 11:39 ` Tejun Heo @ 2013-10-27 11:39 ` Tejun Heo 1 sibling, 0 replies; 7+ messages in thread From: Tejun Heo @ 2013-10-27 11:39 UTC (permalink / raw) To: Daniel Walker Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA On Fri, Oct 25, 2013 at 07:33:13PM -0700, Daniel Walker wrote: > Signed-off-by: Daniel Walker <dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org> Can you please briefly explain why this conversion is happening in the patch description? Thanks. -- tejun ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 3/3] cgroups: remove calls to simple_kstrtoll @ 2013-10-26 2:33 Daniel Walker 0 siblings, 0 replies; 7+ messages in thread From: Daniel Walker @ 2013-10-26 2:33 UTC (permalink / raw) To: Tejun Heo, Li Zefan Cc: cgroups-u79uwXL29TY76Z2rM5mHXA, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA, linux-kernel-u79uwXL29TY76Z2rM5mHXA Signed-off-by: Daniel Walker <dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org> --- 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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-10-27 15:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-26 2:33 [PATCH 3/3] cgroups: remove calls to simple_kstrtoll Daniel Walker
[not found] ` <1382754793-8827-3-git-send-email-dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org>
2013-10-27 11:39 ` Tejun Heo
2013-10-27 11:39 ` Tejun Heo
[not found] ` <20131027113925.GF14934-9pTldWuhBndy/B6EtB590w@public.gmane.org>
2013-10-27 15:12 ` Daniel Walker
2013-10-27 15:12 ` Daniel Walker
2013-10-27 11:39 ` Tejun Heo
-- strict thread matches above, loose matches on Subject: below --
2013-10-26 2:33 Daniel Walker
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.