提交 d9c2ede6 编写于 作者: E Eldad Zack 提交者: J. Bruce Fields

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: NEldad Zack <eldad@fogrefinery.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 7f2e7dc0
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册