mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH V2] kernel/res_counter.c: replace simple_strtoull by kstrtoull
@ 2014-05-08 17:00 Fabian Frederick
  2014-05-08 20:54 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Fabian Frederick @ 2014-05-08 17:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Michal Hocko

Thanks to Andrew Morton for commenting first version.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
V2: Suggestions by Andrew Morton
-use internal rc variable
-simplify if condition
 kernel/res_counter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/res_counter.c b/kernel/res_counter.c
index 51dbac6..f65a95c 100644
--- a/kernel/res_counter.c
+++ b/kernel/res_counter.c
@@ -186,8 +186,8 @@ int res_counter_memparse_write_strategy(const char *buf,
 
 	/* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
 	if (*buf == '-') {
-		res = simple_strtoull(buf + 1, &end, 10);
-		if (res != 1 || *end != '\0')
+		int rc = kstrtoull(buf + 1, 10, &res);
+		if ((res != 1) || rc)
 			return -EINVAL;
 		*resp = RES_COUNTER_MAX;
 		return 0;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-08 20:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-08 17:00 [PATCH V2] kernel/res_counter.c: replace simple_strtoull by kstrtoull Fabian Frederick
2014-05-08 20:54 ` Andrew Morton

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®