mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-01 09:46:46 +07:00
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>
This commit is contained in:
parent
7f2e7dc0fd
commit
d9c2ede63c
@ -219,11 +219,17 @@ static inline int get_int(char **bpp, int *anint)
|
|||||||
char buf[50];
|
char buf[50];
|
||||||
char *ep;
|
char *ep;
|
||||||
int rv;
|
int rv;
|
||||||
int len = qword_get(bpp, buf, 50);
|
int len = qword_get(bpp, buf, sizeof(buf));
|
||||||
if (len < 0) return -EINVAL;
|
|
||||||
if (len ==0) return -ENOENT;
|
if (len < 0)
|
||||||
|
return -EINVAL;
|
||||||
|
if (len == 0)
|
||||||
|
return -ENOENT;
|
||||||
|
|
||||||
rv = simple_strtol(buf, &ep, 0);
|
rv = simple_strtol(buf, &ep, 0);
|
||||||
if (*ep) return -EINVAL;
|
if (*ep)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
*anint = rv;
|
*anint = rv;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user