From patchwork Sat Sep 28 16:23:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 2958031 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 E52A7BFF0B for ; Sat, 28 Sep 2013 16:25:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21A1E2035F for ; Sat, 28 Sep 2013 16:25:03 +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 2127B202D1 for ; Sat, 28 Sep 2013 16:25:02 +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 1VPxJW-0007FF-TV; Sat, 28 Sep 2013 16:24:15 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPxJH-0005Ng-0g; Sat, 28 Sep 2013 16:23:59 +0000 Received: from mail-qe0-f48.google.com ([209.85.128.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VPxIq-0005JE-0I for linux-arm-kernel@lists.infradead.org; Sat, 28 Sep 2013 16:23:32 +0000 Received: by mail-qe0-f48.google.com with SMTP id nd7so2659474qeb.21 for ; Sat, 28 Sep 2013 09:23:09 -0700 (PDT) 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=BnWlauup1DdcLIWZnqt/oVJQjIpQdxjbQgk9AvPUpTEYGKyGArWXv+M48UFLS85BSe h7HEMPxIXvG68Ogt42AAepWRWpXsinT3GeOKz+qBiecMjCDISdy2+2CVVmDm7w8gcAra nBZzKcANzSORB9vG4jfroCe7UpjOOWKIHUDMQFk+v5D6qnmKnrkZeS1bfmohAK5IWEHB Nf5/nXWM5EiTuwsn8RP+mGpCR6Jp+zZBV1zfa9RfD3VbimC0sMzLKo+L6MtzD14MSbau 7dHfkK0YjZQo4xRBGQyrTX5wcKoY1Qr7G2w8sN5ynCfzRItHyruBkUAZOYoE/kv+i4eW ugaw== X-Gm-Message-State: ALoCoQnP5+KknYkRmMDHWmG4vDMMI1Ok5bTR7uykFXmebQo7bP/4c0CuASXjJKOh4MDFOCkSfKeT X-Received: by 10.49.35.106 with SMTP id g10mr17233552qej.35.1380385389122; Sat, 28 Sep 2013 09:23:09 -0700 (PDT) Received: from rfranz-t520.caveonetworks.com (static-108-20-23-67.bstnma.fios.verizon.net. [108.20.23.67]) by mx.google.com with ESMTPSA id l2sm31145506qad.10.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 28 Sep 2013 09:23:08 -0700 (PDT) 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 3/6] Add strstr to compressed string.c for ARM. Date: Sat, 28 Sep 2013 09:23:20 -0700 Message-Id: <1380385403-31904-4-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1380385403-31904-1-git-send-email-roy.franz@linaro.org> References: <1380385403-31904-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130928_122332_124133_BF866D25 X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) Cc: grant.likely@linaro.org, Roy Franz , dave.martin@arm.com, leif.lindholm@linaro.org, msalter@redhat.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=-6.6 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)