From: Rob Herring Date: Thu, 1 Mar 2018 15:18:22 +0000 (-0600) Subject: ARM: boot: add strrchr function X-Git-Tag: v4.19~1284^2~8^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=60c03a0448c7144d01ef437aae0a1c7e2367b4ba;p=platform%2Fkernel%2Flinux-rpi.git ARM: boot: add strrchr function libfdt gained a new dependency on strrchr, so copy the implementation from lib/string.c. Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring --- diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c index 13c90ab..ade5079 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)