diff options
author | Eldad Zack <eldad@fogrefinery.com> | 2012-07-06 15:31:56 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-07-11 16:07:59 -0400 |
commit | d9c2ede63c74048dfddbb129c59ac01176b0ab71 (patch) | |
tree | 355767a58545b8e1d0626a1d08fe83f26c7228e7 /include/linux/sunrpc | |
parent | 7f2e7dc0fdd9f124da43d1bd12adcebf92bedf16 (diff) |
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>
Diffstat (limited to 'include/linux/sunrpc')
-rw-r--r-- | include/linux/sunrpc/cache.h | 14 |
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) | |||
219 | char buf[50]; | 219 | char buf[50]; |
220 | char *ep; | 220 | char *ep; |
221 | int rv; | 221 | int rv; |
222 | int len = qword_get(bpp, buf, 50); | 222 | int len = qword_get(bpp, buf, sizeof(buf)); |
223 | if (len < 0) return -EINVAL; | 223 | |
224 | if (len ==0) return -ENOENT; | 224 | if (len < 0) |
225 | return -EINVAL; | ||
226 | if (len == 0) | ||
227 | return -ENOENT; | ||
228 | |||
225 | rv = simple_strtol(buf, &ep, 0); | 229 | rv = simple_strtol(buf, &ep, 0); |
226 | if (*ep) return -EINVAL; | 230 | if (*ep) |
231 | return -EINVAL; | ||
232 | |||
227 | *anint = rv; | 233 | *anint = rv; |
228 | return 0; | 234 | return 0; |
229 | } | 235 | } |