summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEldad Zack <eldad@fogrefinery.com>2012-07-06 21:31:56 +0200
committerJ. Bruce Fields <bfields@redhat.com>2012-07-11 16:07:59 -0400
commitd9c2ede63c74048dfddbb129c59ac01176b0ab71 (patch)
tree355767a58545b8e1d0626a1d08fe83f26c7228e7
parent7f2e7dc0fdd9f124da43d1bd12adcebf92bedf16 (diff)
downloadblackbird-op-linux-d9c2ede63c74048dfddbb129c59ac01176b0ab71.tar.gz
blackbird-op-linux-d9c2ede63c74048dfddbb129c59ac01176b0ab71.zip
sunrpc/cache.h: fix coding style
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>
-rw-r--r--include/linux/sunrpc/cache.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index f5fd6160dbca..6def1f6cc269 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -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;
}
OpenPOWER on IntegriCloud