linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: boot: Add an implementation of strnlen for libfdt
@ 2016-02-11 23:06 Rob Herring
  2016-02-11 23:24 ` Russell King - ARM Linux
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2016-02-11 23:06 UTC (permalink / raw)
  To: linux-arm-kernel

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 <robh@kernel.org>
---
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(+)

diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c
index 36e53ef..6894674 100644
--- a/arch/arm/boot/compressed/string.c
+++ b/arch/arm/boot/compressed/string.c
@@ -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;
-- 
2.5.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] ARM: boot: Add an implementation of strnlen for libfdt
  2016-02-11 23:06 [PATCH] ARM: boot: Add an implementation of strnlen for libfdt Rob Herring
@ 2016-02-11 23:24 ` Russell King - ARM Linux
  0 siblings, 0 replies; 2+ messages in thread
From: Russell King - ARM Linux @ 2016-02-11 23:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Feb 11, 2016 at 05:06:34PM -0600, Rob Herring wrote:
> 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 <robh@kernel.org>

Thanks.

Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>

> ---
> 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(+)
> 
> diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c
> index 36e53ef..6894674 100644
> --- a/arch/arm/boot/compressed/string.c
> +++ b/arch/arm/boot/compressed/string.c
> @@ -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;
> -- 
> 2.5.0
> 

-- 
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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-11 23:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-11 23:06 [PATCH] ARM: boot: Add an implementation of strnlen for libfdt Rob Herring
2016-02-11 23:24 ` Russell King - ARM Linux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).