[PATCH 1/2, resend] sunrpc/cache.h: fix coding style

From: Eldad Zack
Date: Fri Jul 06 2012 - 15:32:29 EST


Neaten code style in get_int().
Also use sizeof() instead of hard coded number as suggested by
Joe Perches <joe@xxxxxxxxxxx>.

Cc: Joe Perches <joe@xxxxxxxxxxx>
Signed-off-by: Eldad Zack <eldad@xxxxxxxxxxxxxxx>
---
Resent to include improvements from Joe Perches.
include/linux/sunrpc/cache.h | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index f5fd616..6def1f6 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;
}
--
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/