diff options
author | Yury Norov <[email protected]> | 2020-02-03 17:37:41 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2020-02-04 03:05:27 +0000 |
commit | 190535f7cf50f2d6d6e603715201c58cd6ec696b (patch) | |
tree | a8179d0e8a0e926a0541ebac0bb5d57f9925e565 | |
parent | 809e308f7f854933a792e4a14c4571320cd11f7e (diff) |
include/linux/cpumask.h: don't calculate length of the input string
New design of inner bitmap_parse() allows to avoid calculating the size of
a null-terminated string.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Yury Norov <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Cc: Amritha Nambiar <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Miklos Szeredi <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: "Tobin C . Harding" <[email protected]>
Cc: Vineet Gupta <[email protected]>
Cc: Will Deacon <[email protected]>
Cc: Willem de Bruijn <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | include/linux/cpumask.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 78a73eba64dd..d5cc88514aee 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -663,9 +663,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len, */ static inline int cpumask_parse(const char *buf, struct cpumask *dstp) { - unsigned int len = strchrnul(buf, '\n') - buf; - - return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); + return bitmap_parse(buf, UINT_MAX, cpumask_bits(dstp), nr_cpumask_bits); } /** |