[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200102043031.30357-8-yury.norov@gmail.com>
Date: Wed, 1 Jan 2020 20:30:31 -0800
From: Yury Norov <yury.norov@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
"David S . Miller" <davem@...emloft.net>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Amritha Nambiar <amritha.nambiar@...el.com>,
Willem de Bruijn <willemb@...gle.com>,
Kees Cook <keescook@...omium.org>,
Matthew Wilcox <willy@...radead.org>,
"Tobin C . Harding" <tobin@...nel.org>,
Will Deacon <will.deacon@....com>,
Miklos Szeredi <mszeredi@...hat.com>,
Vineet Gupta <vineet.gupta1@...opsys.com>,
Chris Wilson <chris@...is-wilson.co.uk>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
linux-kernel@...r.kernel.org
Cc: Yury Norov <yury.norov@...il.com>, Jens Axboe <axboe@...nel.dk>,
Steffen Klassert <steffen.klassert@...unet.com>
Subject: [PATCH 7/7] cpumask: don't calculate length of the input string
>From Yury Norov <yury.norov@...il.com>
New design of inner bitmap_parse() allows to avoid
calculating the size of a null-terminated string.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Signed-off-by: Yury Norov <yury.norov@...il.com>
---
include/linux/cpumask.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index 78a73eba64dd6..d5cc88514aee6 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);
}
/**
--
2.20.1
Powered by blists - more mailing lists