[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 03 Mar 2014 15:14:55 +0200
From: Pekka Enberg <penberg@....fi>
To: David Rientjes <rientjes@...gle.com>,
Vegard Nossum <vegardno@....uio.no>,
Andrew Morton <akpm@...ux-foundation.org>,
Pekka Enberg <penberg@...nel.org>
CC: Xishi Qiu <qiuxishi@...wei.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [patch] x86, kmemcheck: Use kstrtoint() instead of sscanf()
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@...gle.com>
Acked-by: Pekka Enberg <penberg@...nel.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists