* [PATCH] efi: libstub: add strnlen() implementation
@ 2016-02-16 15:29 Ard Biesheuvel
[not found] ` <1455636559-7542-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Ard Biesheuvel @ 2016-02-16 15:29 UTC (permalink / raw)
To: linux-efi-u79uwXL29TY76Z2rM5mHXA,
matt-mF/unelCI9GS6iBeEJttW/XRex20P6io
Cc: Ard Biesheuvel
Commit 91feabc2e224 ("scripts/dtc: Update to upstream commit
b06e55c88b9b") introduces references to the strnlen() string function,
which is not currently defined in the EFI stub. So add it to our string.c
Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
drivers/firmware/efi/libstub/string.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/drivers/firmware/efi/libstub/string.c b/drivers/firmware/efi/libstub/string.c
index 09d5a0894343..d4055ab80116 100644
--- a/drivers/firmware/efi/libstub/string.c
+++ b/drivers/firmware/efi/libstub/string.c
@@ -55,3 +55,19 @@ int strncmp(const char *cs, const char *ct, size_t count)
return 0;
}
#endif
+
+#ifndef __HAVE_ARCH_STRNLEN
+/**
+ * strnlen - Find the length of a length-limited string
+ * @s: The string to be sized
+ * @count: The maximum number of bytes to search
+ */
+size_t strnlen(const char *s, size_t count)
+{
+ const char *sc;
+
+ for (sc = s; count-- && *sc != '\0'; ++sc)
+ /* nothing */;
+ return sc - s;
+}
+#endif
--
2.5.0
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <1455636559-7542-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* Re: [PATCH] efi: libstub: add strnlen() implementation [not found] ` <1455636559-7542-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2016-02-18 11:04 ` Matt Fleming [not found] ` <20160218110446.GD2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Matt Fleming @ 2016-02-18 11:04 UTC (permalink / raw) To: Ard Biesheuvel; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA On Tue, 16 Feb, at 04:29:19PM, Ard Biesheuvel wrote: > Commit 91feabc2e224 ("scripts/dtc: Update to upstream commit > b06e55c88b9b") introduces references to the strnlen() string function, > which is not currently defined in the EFI stub. So add it to our string.c > > Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > --- > drivers/firmware/efi/libstub/string.c | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) Does this patch fix a build failure for ARM? Which tree is the above commit in? ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20160218110446.GD2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>]
* Re: [PATCH] efi: libstub: add strnlen() implementation [not found] ` <20160218110446.GD2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> @ 2016-02-18 11:05 ` Ard Biesheuvel [not found] ` <CAKv+Gu_bhat3RjoLDqUtUBG7bB0ECAdS1i4GF_AU9h=YfWz=tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Ard Biesheuvel @ 2016-02-18 11:05 UTC (permalink / raw) To: Matt Fleming; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 18 February 2016 at 12:04, Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> wrote: > On Tue, 16 Feb, at 04:29:19PM, Ard Biesheuvel wrote: >> Commit 91feabc2e224 ("scripts/dtc: Update to upstream commit >> b06e55c88b9b") introduces references to the strnlen() string function, >> which is not currently defined in the EFI stub. So add it to our string.c >> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> --- >> drivers/firmware/efi/libstub/string.c | 16 ++++++++++++++++ >> 1 file changed, 16 insertions(+) > > Does this patch fix a build failure for ARM? Which tree is the above > commit in? It is in -next, and it will break the build once it hits upstream. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAKv+Gu_bhat3RjoLDqUtUBG7bB0ECAdS1i4GF_AU9h=YfWz=tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] efi: libstub: add strnlen() implementation [not found] ` <CAKv+Gu_bhat3RjoLDqUtUBG7bB0ECAdS1i4GF_AU9h=YfWz=tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2016-02-18 13:33 ` Matt Fleming [not found] ` <20160218133337.GF2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Matt Fleming @ 2016-02-18 13:33 UTC (permalink / raw) To: Ard Biesheuvel; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Thu, 18 Feb, at 12:05:51PM, Ard Biesheuvel wrote: > On 18 February 2016 at 12:04, Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> wrote: > > On Tue, 16 Feb, at 04:29:19PM, Ard Biesheuvel wrote: > >> Commit 91feabc2e224 ("scripts/dtc: Update to upstream commit > >> b06e55c88b9b") introduces references to the strnlen() string function, > >> which is not currently defined in the EFI stub. So add it to our string.c > >> > >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > >> --- > >> drivers/firmware/efi/libstub/string.c | 16 ++++++++++++++++ > >> 1 file changed, 16 insertions(+) > > > > Does this patch fix a build failure for ARM? Which tree is the above > > commit in? > > It is in -next, and it will break the build once it hits upstream. OK, could you resend and include the build failure in the commit log and make a reference to fixing a build issue? ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <20160218133337.GF2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>]
* Re: [PATCH] efi: libstub: add strnlen() implementation [not found] ` <20160218133337.GF2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> @ 2016-02-18 14:01 ` Ard Biesheuvel 0 siblings, 0 replies; 5+ messages in thread From: Ard Biesheuvel @ 2016-02-18 14:01 UTC (permalink / raw) To: Matt Fleming; +Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On 18 February 2016 at 14:33, Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> wrote: > On Thu, 18 Feb, at 12:05:51PM, Ard Biesheuvel wrote: >> On 18 February 2016 at 12:04, Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org> wrote: >> > On Tue, 16 Feb, at 04:29:19PM, Ard Biesheuvel wrote: >> >> Commit 91feabc2e224 ("scripts/dtc: Update to upstream commit >> >> b06e55c88b9b") introduces references to the strnlen() string function, >> >> which is not currently defined in the EFI stub. So add it to our string.c >> >> >> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> >> --- >> >> drivers/firmware/efi/libstub/string.c | 16 ++++++++++++++++ >> >> 1 file changed, 16 insertions(+) >> > >> > Does this patch fix a build failure for ARM? Which tree is the above >> > commit in? >> >> It is in -next, and it will break the build once it hits upstream. > > OK, could you resend and include the build failure in the commit log > and make a reference to fixing a build issue? Actually, I spoke too soon. While the issue does exist on arm64, ARM already has a special version of strnlen() in its decompressor. Sorry for the noise. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-02-18 14:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-16 15:29 [PATCH] efi: libstub: add strnlen() implementation Ard Biesheuvel
[not found] ` <1455636559-7542-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-02-18 11:04 ` Matt Fleming
[not found] ` <20160218110446.GD2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-02-18 11:05 ` Ard Biesheuvel
[not found] ` <CAKv+Gu_bhat3RjoLDqUtUBG7bB0ECAdS1i4GF_AU9h=YfWz=tw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-18 13:33 ` Matt Fleming
[not found] ` <20160218133337.GF2651-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2016-02-18 14:01 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox