]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/util.c: add kstrimdup()
authorSebastian Capella <sebastian.capella@linaro.org>
Thu, 22 May 2014 00:43:40 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:40 +0000 (10:43 +1000)
commitb58fae42e7e00a8ca0c3383a768e3a4e9183966e
tree09953905daee8a758c47174dface01934ef9f00d
parent0f2490a9b8a16d99a64c7a0a7efad073710837ba
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