The patch titled Subject: include/linux/cpumask.h: don't calculate length of the input string has been added to the -mm tree. Its filename is cpumask-dont-calculate-length-of-the-input-string.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/cpumask-dont-calculate-length-of-the-input-string.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/cpumask-dont-calculate-length-of-the-input-string.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Yury Norov <yury.norov@xxxxxxxxx> Subject: 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/20200102043031.30357-8-yury.norov@xxxxxxxxx Signed-off-by: Yury Norov <yury.norov@xxxxxxxxx> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Cc: Amritha Nambiar <amritha.nambiar@xxxxxxxxx> Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Cc: Kees Cook <keescook@xxxxxxxxxxxx> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Cc: Miklos Szeredi <mszeredi@xxxxxxxxxx> Cc: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx> Cc: Steffen Klassert <steffen.klassert@xxxxxxxxxxx> Cc: "Tobin C . Harding" <tobin@xxxxxxxxxx> Cc: Vineet Gupta <vineet.gupta1@xxxxxxxxxxxx> Cc: Will Deacon <will.deacon@xxxxxxx> Cc: Willem de Bruijn <willemb@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/cpumask.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/include/linux/cpumask.h~cpumask-dont-calculate-length-of-the-input-string +++ a/include/linux/cpumask.h @@ -663,9 +663,7 @@ static inline int cpumask_parselist_user */ 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); } /** _ Patches currently in -mm which might be from yury.norov@xxxxxxxxx are lib-string-add-strnchrnul.patch bitops-more-bits_to_-macros.patch lib-add-test-for-bitmap_parse.patch lib-add-test-for-bitmap_parse-fix.patch lib-make-bitmap_parse_user-a-wrapper-on-bitmap_parse.patch lib-rework-bitmap_parse.patch lib-new-testcases-for-bitmap_parse_user.patch cpumask-dont-calculate-length-of-the-input-string.patch