[7/7] cpumask: don't calculate length of the input string
diff mbox series

Message ID 20190721212753.3287-8-yury.norov@gmail.com
State New
Headers show
Series
  • lib: rework bitmap_parse
Related show

Commit Message

Yury Norov July 21, 2019, 9:27 p.m. UTC
From Yury Norov <ynorov@marvell.com>

New design of inner bitmap_parse() allows to avoid
calculating the size of a null-terminated string.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Yury Norov <ynorov@marvell.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
---
 include/linux/cpumask.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 21755471b1c31..d55d015edc58a 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -633,9 +633,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);
 }
 
 /**