summaryrefslogtreecommitdiff
path: root/arch/arm/boot/compressed
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2018-03-01 09:18:22 -0600
committerRob Herring <robh@kernel.org>2018-03-01 12:02:48 -0600
commit60c03a0448c7144d01ef437aae0a1c7e2367b4ba (patch)
treea1dc4a690d4138ff1f069355614780cefac690d0 /arch/arm/boot/compressed
parentf26e93812a4f74d255fa6d548af5a303457f390b (diff)
ARM: boot: add strrchr function
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>
Diffstat (limited to 'arch/arm/boot/compressed')
-rw-r--r--arch/arm/boot/compressed/string.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c
index 13c90abc68d6..ade5079bebbf 100644
--- 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)