]> git.baikalelectronics.ru Git - kernel.git/commit
lib/bitmap.c: bitmap_parselist can accept string with whitespaces on head or tail
authorPan Xinhui <xinhuix.pan@intel.com>
Wed, 9 Sep 2015 22:37:08 +0000 (15:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 10 Sep 2015 20:29:01 +0000 (13:29 -0700)
commit122e0c2237f08bdd238553128a7b4a872de09906
tree8639fa0b9de8011692d06d06d6756ff372d3f5f0
parentbbaa7f49cf7eeec2d3f8eb057818d2b9223c2758
lib/bitmap.c: bitmap_parselist can accept string with whitespaces on head or tail

In __bitmap_parselist we can accept whitespaces on head or tail during
every parsing procedure.  If input has valid ranges, there is no reason to
reject the user.

For example, bitmap_parselist(" 1-3, 5, ", &mask, nmaskbits).  After
separating the string, we get " 1-3", " 5", and " ".  It's possible and
reasonable to accept such string as long as the parsing result is correct.

Signed-off-by: Pan Xinhui <xinhuix.pan@intel.com>
Cc: Yury Norov <yury.norov@gmail.com>
Cc: Chris Metcalf <cmetcalf@ezchip.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/bitmap.c