Skip to contentSkip to conversation

cgroups: remove calls to simple_kstrtoll

PATCH In review Daniel Walker 3 participants 4 messages Oct 26, 2013 – Oct 27, 2013 1 message not in the archive cgroup

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 cgroups: remove calls to simple_kstrtoll

---
 kernel/cgroup.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
kernel/cgroup.c +7 -5
index 41f71c3..bf8b891 100644
@@ -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);
 	}
Signature · 1 line
1.8.3.2
#2 lore raw

Sure , I can add it .. It's because simple_strtoll is obsolete ..

Quoted 11 lines · Tejun Heo
Quoted 1 line · Daniel Walker

Can you please briefly explain why this conversion is happening in the patch description?

Thanks.

Signature · 1 line
tejun

A message that is not in the archive (sent off-list or not yet received): 1382754793-8827-3-git-send-email-dwalker-zu3NM2574RrQT0dZR+AlfA@public.gmane.org