lkml.org 
[lkml]   [2014]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] kernel/res_counter.c: replace simple_strtoull by kstrtoull
On Wed, 7 May 2014 22:37:32 +0200 Fabian Frederick <fabf@skynet.be> wrote:

> --- a/kernel/res_counter.c
> +++ b/kernel/res_counter.c
> @@ -183,11 +183,12 @@ int res_counter_memparse_write_strategy(const char *buf,
> {
> char *end;
> unsigned long long res;
> + int rc;
>
> /* return RES_COUNTER_MAX(unlimited) if "-1" is specified */
> if (*buf == '-') {
> - res = simple_strtoull(buf + 1, &end, 10);
> - if (res != 1 || *end != '\0')
> + rc = kstrtoull(buf + 1, 10, &res);

There's no need to give `rc' function-wide scope.

int rc = kstrtoull(buf + 1, 10, &res);

will work here.

> + if ((res != 1) || (rc))

And that's over-parenthesized.

> return -EINVAL;
> *resp = RES_COUNTER_MAX;
> return 0;



\
 
 \ /
  Last update: 2014-05-08 01:21    [W:0.033 / U:1.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site