lkml.org 
[lkml]   [2012]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] sunrpc/cache.h: replace simple_strtoul
On Thu, Jul 05, 2012 at 01:00:26AM +0200, Eldad Zack wrote:
> This patch replaces the usage of simple_strtoul with kstrtoint in
> get_int().

Why?

--b.

>
> Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
> ---
> include/linux/sunrpc/cache.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
> index 0757887..9a60bcc 100644
> --- a/include/linux/sunrpc/cache.h
> +++ b/include/linux/sunrpc/cache.h
> @@ -217,7 +217,7 @@ extern int qword_get(char **bpp, char *dest, int bufsize);
> static inline int get_int(char **bpp, int *anint)
> {
> char buf[50];
> - char *ep;
> + ssize_t ret;
> int rv;
> int len = qword_get(bpp, buf, 50);
>
> @@ -226,8 +226,8 @@ static inline int get_int(char **bpp, int *anint)
> if (len == 0)
> return -ENOENT;
>
> - rv = simple_strtol(buf, &ep, 0);
> - if (*ep)
> + ret = kstrtoint(buf, 0, &rv);
> + if (ret)
> return -EINVAL;
>
> *anint = rv;
> --
> 1.7.10
>


\
 
 \ /
  Last update: 2012-07-05 02:21    [W:0.108 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site