]> git.baikalelectronics.ru Git - kernel.git/commit
lib/string.c: simplify str[c]spn
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Fri, 29 Apr 2022 21:38:01 +0000 (14:38 -0700)
committerakpm <akpm@linux-foundation.org>
Fri, 29 Apr 2022 21:38:01 +0000 (14:38 -0700)
commit19cbd61fa3a4ea7e2213384310f6af57bcc0b5aa
tree6f39e7834212d6093b827e8d2e892ef27513a50b
parent808174bd44c1121b78efe97bf0efc844961e9b7e
lib/string.c: simplify str[c]spn

Use strchr(), which makes them a lot shorter, and more obviously symmetric
in their treatment of accept/reject.  It also saves a little bit of .text;
bloat-o-meter for an arm build says

Function                                     old     new   delta
strcspn                                       92      76     -16
strspn                                       108      76     -32

While here, also remove a stray empty line before EXPORT_SYMBOL().

Link: https://lkml.kernel.org/r/20220328224119.3003834-2-linux@rasmusvillemoes.dk
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/string.c