From patchwork Wed Nov 27 23:31:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 3250841 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2A146C045B for ; Wed, 27 Nov 2013 23:32:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4BEE020613 for ; Wed, 27 Nov 2013 23:32:45 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4774E2060B for ; Wed, 27 Nov 2013 23:32:44 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vloaz-0006BC-Aj; Wed, 27 Nov 2013 23:32:37 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vloaw-0004u3-7d; Wed, 27 Nov 2013 23:32:34 +0000 Received: from mail-ie0-f181.google.com ([209.85.223.181]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vloar-0004sR-CH for linux-arm-kernel@lists.infradead.org; Wed, 27 Nov 2013 23:32:30 +0000 Received: by mail-ie0-f181.google.com with SMTP id e14so12859104iej.40 for ; Wed, 27 Nov 2013 15:32:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1HyubkUNXUmWOxSiOxM7s/kKs9krF+9B/0srjjPeJHw=; b=dInj1hVY+//r4c7aWhxfUSXbN+36Uj5MM5WDJVaczUMij2UPUjnJt8NCZVsyjBZAXF 41N5hFmKC132KHWu+fDOn/1WYLpXn5g1Q0avbvbh2+6kGcm5d7BCHqlreBllYrHBwxOj mQkwwTZCOlCduGt6GwTk+acHzHtgQ+bwJpq6Hyx66TUW3HNjlYVU9/bm9O5neotoLG3f ViiMpiMGj+w33DJswSrUszMHfOTpaMjEzUistpArJ3Z/JOEFf+MCx2u657+WBiconz8C 6Wh2b1W8Krk9kWNm059lMuA/TImmMgCDyPM43rjdHvRI16pKmTyCYKI5dqs5xpk7ifjt Ewww== X-Gm-Message-State: ALoCoQmPrh6pjyTQ23SaCs/4m9efX9ksQ/xGoze+cL+tGWqNrrDfkxysHzyWmP8mBLTprdClnDcY X-Received: by 10.42.149.130 with SMTP id w2mr115760icv.64.1385595129416; Wed, 27 Nov 2013 15:32:09 -0800 (PST) Received: from rfranz-v430.caveonetworks.com (64.2.3.195.ptr.us.xo.net. [64.2.3.195]) by mx.google.com with ESMTPSA id p5sm41764439igj.10.2013.11.27.15.32.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Nov 2013 15:32:08 -0800 (PST) From: Roy Franz 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 Subject: [PATCH V5 3/6] Add strstr to compressed string.c for ARM. Date: Wed, 27 Nov 2013 15:31:52 -0800 Message-Id: <1385595115-21488-4-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1385595115-21488-1-git-send-email-roy.franz@linaro.org> References: <1385595115-21488-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131127_183229_482780_51854914 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: patches@linaro.org, leif.lindholm@linaro.org, Roy Franz , msalter@redhat.com, grant.likely@linaro.org, dave.martin@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The shared efi-stub-helper.c functions require a strstr implementation. Implementation copied from arch/x86/boot/string.c Signed-off-by: Roy Franz Reviewed-by: Grant Likely --- 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)