lib: bitmap: simplify bitmap_parselist
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Wed, 6 Aug 2014 23:10:12 +0000 (16:10 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 7 Aug 2014 01:01:26 +0000 (18:01 -0700)
commitbc5be1828065681300f3727ab55fac0d7ef37af3
treec279a498e6da81b3ce6f4fd422982d430fa20883
parent154f5e38f30f262025c8c2e825376f6eb51e8bcb
lib: bitmap: simplify bitmap_parselist

We want len to be the index of the first '\n', or the length of the
string if there is no newline.  This is a good example of the usefulness
of strchrnul().  Use that instead, thus eliminating a branch and a call
to strlen().

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/bitmap.c