]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/util.c: add kstrimdup()
authorSebastian Capella <sebastian.capella@linaro.org>
Wed, 21 Oct 2015 22:03:54 +0000 (09:03 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 21 Oct 2015 22:03:54 +0000 (09:03 +1100)
commit31a4e7f0de31b545ff8d854fe29791b1eefcd1f9
treec9863bb7918d3e8951dd2d3231bc35a9d28594da
parent641e7642617127da14e683da8ec690d8404ea83f
mm/util.c: add kstrimdup()

kstrimdup() creates a whitespace-trimmed duplicate of the passed in
null-terminated string.  This is useful for strings coming from sysfs that
often include trailing whitespace due to user input.

Thanks to Joe Perches for this implementation.

Signed-off-by: Sebastian Capella <sebastian.capella@linaro.org>
Cc: Joe Perches <joe@perches.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/string.h
mm/util.c