projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f26e938
)
ARM: boot: add strrchr function
author
Rob Herring
<robh@kernel.org>
Thu, 1 Mar 2018 15:18:22 +0000
(09:18 -0600)
committer
Rob Herring
<robh@kernel.org>
Thu, 1 Mar 2018 18:02:48 +0000
(12:02 -0600)
libfdt gained a new dependency on strrchr, so copy the implementation
from lib/string.c.
Cc: Russell King <linux@armlinux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
arch/arm/boot/compressed/string.c
patch
|
blob
|
history
diff --git
a/arch/arm/boot/compressed/string.c
b/arch/arm/boot/compressed/string.c
index 13c90abc68d68a9c5a73502beacb17aef1c89132..ade5079bebbf9c96dd3ff5c1ed93bf9ef7f3e474 100644
(file)
--- a/
arch/arm/boot/compressed/string.c
+++ b/
arch/arm/boot/compressed/string.c
@@
-121,6
+121,16
@@
char *strchr(const char *s, int c)
return (char *)s;
}
+char *strrchr(const char *s, int c)
+{
+ const char *last = NULL;
+ do {
+ if (*s == (char)c)
+ last = s;
+ } while (*s++);
+ return (char *)last;
+}
+
#undef memset
void *memset(void *s, int c, size_t count)