From: Pekka Enberg <penberg@iki.fi>
To: David Rientjes <rientjes@google.com>,
Vegard Nossum <vegardno@ifi.uio.no>,
Andrew Morton <akpm@linux-foundation.org>,
Pekka Enberg <penberg@kernel.org>
Cc: Xishi Qiu <qiuxishi@huawei.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] x86, kmemcheck: Use kstrtoint() instead of sscanf()
Date: Mon, 03 Mar 2014 15:14:55 +0200 [thread overview]
Message-ID: <5314804F.9090806@iki.fi> (raw)
In-Reply-To: <alpine.DEB.2.02.1402191412300.31921@chino.kir.corp.google.com>
On 02/20/2014 12:14 AM, David Rientjes wrote:
> Kmemcheck should use the preferred interface for parsing command line
> arguments, kstrto*(), rather than sscanf() itself. Use it appropriately.
>
> Signed-off-by: David Rientjes <rientjes@google.com>
Acked-by: Pekka Enberg <penberg@kernel.org>
Andrew, can you pick this up?
> ---
> arch/x86/mm/kmemcheck/kmemcheck.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/mm/kmemcheck/kmemcheck.c b/arch/x86/mm/kmemcheck/kmemcheck.c
> --- a/arch/x86/mm/kmemcheck/kmemcheck.c
> +++ b/arch/x86/mm/kmemcheck/kmemcheck.c
> @@ -78,10 +78,16 @@ early_initcall(kmemcheck_init);
> */
> static int __init param_kmemcheck(char *str)
> {
> + int val;
> + int ret;
> +
> if (!str)
> return -EINVAL;
>
> - sscanf(str, "%d", &kmemcheck_enabled);
> + ret = kstrtoint(str, 0, &val);
> + if (ret)
> + return ret;
> + kmemcheck_enabled = val;
> return 0;
> }
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-03-03 13:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 6:56 mm: OS boot failed when set command-line kmemcheck=1 Xishi Qiu
2014-02-19 7:49 ` David Rientjes
2014-02-19 9:35 ` Xishi Qiu
2014-02-19 22:24 ` David Rientjes
2014-02-26 8:12 ` Xishi Qiu
2014-02-26 8:43 ` Peter Zijlstra
2014-02-26 10:14 ` Vegard Nossum
2014-02-26 10:30 ` Peter Zijlstra
2014-03-12 9:15 ` Xishi Qiu
2014-02-19 22:14 ` [patch] x86, kmemcheck: Use kstrtoint() instead of sscanf() David Rientjes
2014-03-03 13:14 ` Pekka Enberg [this message]
2014-03-04 5:07 ` David Rientjes
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=5314804F.9090806@iki.fi \
--to=penberg@iki.fi \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=penberg@kernel.org \
--cc=qiuxishi@huawei.com \
--cc=rientjes@google.com \
--cc=vegardno@ifi.uio.no \
/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;
as well as URLs for NNTP newsgroup(s).