summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c512a80)
raw | patch | inline | side by side (parent: c512a80)
author | Rob Herring <robh@kernel.org> | |
Thu, 11 Feb 2016 22:59:12 +0000 (16:59 -0600) | ||
committer | Robert Nelson <robertcnelson@gmail.com> | |
Fri, 29 Sep 2017 19:43:40 +0000 (14:43 -0500) |
Recent versions of libfdt add a dependency on strnlen. Copy the
implementation in lib/string.c here, so we can update libfdt.
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Rob Herring <robh@kernel.org>
implementation in lib/string.c here, so we can update libfdt.
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Rob Herring <robh@kernel.org>
arch/arm/boot/compressed/string.c | patch | blob | history |
index 36e53ef9200f236d7ad2c5e8cdcb9b7b372f0aa3..68946744873677292a32652828cd7accedd3e858 100644 (file)
return sc - s;
}
+size_t strnlen(const char *s, size_t count)
+{
+ const char *sc;
+
+ for (sc = s; count-- && *sc != '\0'; ++sc)
+ /* nothing */;
+ return sc - s;
+}
+
int memcmp(const void *cs, const void *ct, size_t count)
{
const unsigned char *su1 = cs, *su2 = ct, *end = su1 + count;