From: Andrew Morton <akpm@linux-foundation.org>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Michal Hocko <mhocko@suse.cz>
Subject: Re: [PATCH 1/1] kernel/res_counter.c: replace simple_strtoull by kstrtoull
Date: Wed, 7 May 2014 15:34:03 -0700 [thread overview]
Message-ID: <20140507153403.3cbcbf2de848b1c0c8f332d2@linux-foundation.org> (raw)
In-Reply-To: <20140507223732.2e9fa81810ce05b72247556c@skynet.be>
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;
prev parent reply other threads:[~2014-05-07 22:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-07 20:37 Fabian Frederick
2014-05-07 22:34 ` Andrew Morton [this message]
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=20140507153403.3cbcbf2de848b1c0c8f332d2@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.cz \
/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
Powered by JetHome