ARM: boot: Add an implementation of strnlen for libfdt
PATCH 1/1 ARM: boot: Add an implementation of strnlen for libfdt
Recent versions of libfdt add a dependency on strnlen. Copy the implementation in lib/string.c here, so we can update libfdt.
Signed-off-by Rob Herring <[email protected]>
---
Russell,
I have a pending libfdt update, so I'd like to take this thru the DT tree with your ack.
Rob
arch/arm/boot/compressed/string.c | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/compressed/string.c +9 -0
@@ -65,6 +65,15 @@ size_t strlen(const char *s)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;
Signature · 1 line
2.5.0
PATCH 1/1 ARM: boot: Add an implementation of strnlen for libfdt
Quoted 4 lines · Rob Herring
Recent versions of libfdt add a dependency on strnlen. Copy the implementation in
lib/string.chere, so we can update libfdt.Signed-off-by Rob Herring <[email protected]>
Thanks.
Acked-by Russell King <[email protected]>
Quoted 34 lines
---
Russell,I have a pending libfdt update, so I'd like to take this thru the DT tree with your ack.
Rob
arch/arm/boot/compressed/string.c | 9 +++++++++ 1 file changed, 9 insertions(+)arch/arm/boot/compressed/string.c +9
-0@@ -65,6 +65,15 @@ size_t strlen(const char *s)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;Signature · 1 line
2.5.0
Signature · 3 lines
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.