sunrpc/cache.h: fix coding style
authorEldad Zack <eldad@fogrefinery.com>
Fri, 6 Jul 2012 19:31:56 +0000 (21:31 +0200)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 11 Jul 2012 20:07:59 +0000 (16:07 -0400)
Neaten code style in get_int().
Also use sizeof() instead of hard coded number as suggested by
Joe Perches <joe@perches.com>.

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Eldad Zack <eldad@fogrefinery.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
include/linux/sunrpc/cache.h

index f5fd6160dbca396835773609586e65071f9c78ab..6def1f6cc26907f4468b79499b9d443d826228e4 100644 (file)
@@ -219,11 +219,17 @@ static inline int get_int(char **bpp, int *anint)
        char buf[50];
        char *ep;
        int rv;
-       int len = qword_get(bpp, buf, 50);
-       if (len < 0) return -EINVAL;
-       if (len ==0) return -ENOENT;
+       int len = qword_get(bpp, buf, sizeof(buf));
+
+       if (len < 0)
+               return -EINVAL;
+       if (len == 0)
+               return -ENOENT;
+
        rv = simple_strtol(buf, &ep, 0);
-       if (*ep) return -EINVAL;
+       if (*ep)
+               return -EINVAL;
+
        *anint = rv;
        return 0;
 }