summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-06-28 07:19:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-28 14:50:03 +0200
commit5eb71097bf476954a0da4279b496997ae27e60fa (patch)
tree46f7aa3f301d2b009bac1e1ed8487bbd7e843a45 /include
parent45bad4394d50034a8cd157b0f01d2807a5dab372 (diff)
downloadbarebox-5eb71097bf476954a0da4279b496997ae27e60fa.tar.gz
barebox-5eb71097bf476954a0da4279b496997ae27e60fa.tar.xz
string: implement strchrnul
We have at least two places opencoding strchrnul, one of them needlessly iterating twice instead of once over the string. Replace both by calling a common single pass implementation. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20210628051934.9604-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/string.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h
index 55bc905c0e..47a27a391f 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -25,6 +25,10 @@ extern __kernel_size_t strspn(const char *,const char *);
(typeof(&(s1)[0]))(_strstr((s1), (s2))); \
})
+#ifndef __HAVE_ARCH_STRCHRNUL
+extern char * strchrnul(const char *,int);
+#endif
+
/*
* Include machine specific inline routines
*/