From: Roy Franz <roy.franz@linaro.org>
To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, matt.fleming@intel.com,
linux@arm.linux.org.uk
Cc: leif.lindholm@linaro.org, Roy Franz <roy.franz@linaro.org>
Subject: [PATCH 5/7] Add strstr to compressed string.c for ARM.
Date: Fri, 2 Aug 2013 14:29:06 -0700 [thread overview]
Message-ID: <1375478948-22562-6-git-send-email-roy.franz@linaro.org> (raw)
In-Reply-To: <1375478948-22562-1-git-send-email-roy.franz@linaro.org>
The shared efi-stub-helper.c functions require a strstr
implementation.
Implementation copied from arch/x86/boot/string.c
Signed-off-by: Roy Franz <roy.franz@linaro.org>
---
arch/arm/boot/compressed/string.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c
index 36e53ef..5397792 100644
--- a/arch/arm/boot/compressed/string.c
+++ b/arch/arm/boot/compressed/string.c
@@ -111,6 +111,27 @@ char *strchr(const char *s, int c)
return (char *)s;
}
+/**
+ * strstr - Find the first substring in a %NUL terminated string
+ * @s1: The string to be searched
+ * @s2: The string to search for
+ */
+char *strstr(const char *s1, const char *s2)
+{
+ size_t l1, l2;
+
+ l2 = strlen(s2);
+ if (!l2)
+ return (char *)s1;
+ l1 = strlen(s1);
+ while (l1 >= l2) {
+ l1--;
+ if (!memcmp(s1, s2, l2))
+ return (char *)s1;
+ s1++;
+ }
+ return NULL;
+}
#undef memset
void *memset(void *s, int c, size_t count)
--
1.7.10.4
next prev parent reply other threads:[~2013-08-02 21:29 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-02 21:29 [PATCH 0/7] RFC: EFI stub for ARM Roy Franz
2013-08-02 21:29 ` [PATCH 1/7] EFI stub documentation updates Roy Franz
[not found] ` <1375478948-22562-2-git-send-email-roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-08-05 14:12 ` Dave Martin
[not found] ` <20130805141221.GC2755-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2013-08-05 23:56 ` Roy Franz
[not found] ` <CAFECyb9h7aSzOAHC0t-xT1mNxW_CuMqpU8zGD50ZzZYQ74d0fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-06 10:30 ` Dave P Martin
2013-08-02 21:29 ` [PATCH 2/7] Move common EFI stub code from x86 arch code to common location Roy Franz
[not found] ` <1375478948-22562-3-git-send-email-roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-08-06 13:53 ` Matt Fleming
[not found] ` <1375478948-22562-1-git-send-email-roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-08-02 21:29 ` [PATCH 3/7] Change EFI helper APIs to be more flexible Roy Franz
[not found] ` <1375478948-22562-4-git-send-email-roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-08-06 13:53 ` Matt Fleming
2013-08-02 21:29 ` [PATCH 6/7] Add EFI stub for ARM Roy Franz
2013-08-05 14:11 ` Dave Martin
2013-08-05 15:33 ` Leif Lindholm
[not found] ` <20130805153318.GL18151-GZEopFhza0F985/tl1ce8aaDwS/vmuI7@public.gmane.org>
2013-08-06 0:06 ` Roy Franz
[not found] ` <CAFECyb-WciwMu0MBmZ8LzkaM=VxnaOH5e9V5f_AP3ZbLA9CW9A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-06 10:40 ` Dave P Martin
2013-08-06 10:31 ` Dave P Martin
2013-08-06 3:35 ` Roy Franz
2013-08-02 21:29 ` [PATCH 4/7] Add proper definitions for some EFI function pointers Roy Franz
[not found] ` <1375478948-22562-5-git-send-email-roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2013-08-06 13:19 ` Matt Fleming
2013-08-02 21:29 ` Roy Franz [this message]
2013-08-02 21:29 ` [PATCH 7/7] Add config EFI_STUB for ARM Roy Franz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1375478948-22562-6-git-send-email-roy.franz@linaro.org \
--to=roy.franz@linaro.org \
--cc=leif.lindholm@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=matt.fleming@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).