projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
30f7bc9
)
lib/parser.c: switch match_u64int() over to use match_strdup()
author
Eric Biggers
<
[email protected]
>
Tue, 30 Oct 2018 22:05:26 +0000
(15:05 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 31 Oct 2018 15:54:12 +0000
(08:54 -0700)
This simplifies the code. No change in behavior.
Link:
http://lkml.kernel.org/r/
[email protected]
Signed-off-by: Eric Biggers <
[email protected]
>
Reviewed-by: Andrew Morton <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/parser.c
patch
|
blob
|
history
diff --git
a/lib/parser.c
b/lib/parser.c
index 0142ef28f0eb4a432d310aa4edc8bd770880876b..618c36ec8efe35278226dd6d8e8b99ead40936f0 100644
(file)
--- a/
lib/parser.c
+++ b/
lib/parser.c
@@
-166,13
+166,10
@@
static int match_u64int(substring_t *s, u64 *result, int base)
char *buf;
int ret;
u64 val;
- size_t len = s->to - s->from;
- buf =
kmalloc(len + 1, GFP_KERNEL
);
+ buf =
match_strdup(s
);
if (!buf)
return -ENOMEM;
- memcpy(buf, s->from, len);
- buf[len] = '\0';
ret = kstrtoull(buf, base, &val);
if (!ret)