From patchwork Fri Aug 9 23:26:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 2842263 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 765499F294 for ; Sat, 10 Aug 2013 00:12:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A32FD2022D for ; Sat, 10 Aug 2013 00:12:41 +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 A762F20225 for ; Sat, 10 Aug 2013 00:12:40 +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 1V7w8W-0002Mm-Hd; Fri, 09 Aug 2013 23:30:26 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7w7R-0003p2-WE; Fri, 09 Aug 2013 23:29:18 +0000 Received: from bombadil.infradead.org ([2001:1868:205::9]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7w5V-0003er-G3 for linux-arm-kernel@merlin.infradead.org; Fri, 09 Aug 2013 23:27:17 +0000 Received: from mail-pb0-f53.google.com ([209.85.160.53]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7w5T-00067O-70 for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2013 23:27:16 +0000 Received: by mail-pb0-f53.google.com with SMTP id up15so5022235pbc.26 for ; Fri, 09 Aug 2013 16:26:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RJ8bu2kmMM0nN1YdD2xDScPsjIew27BhX7p0lSy1s74=; b=E9vbNKQuG5VpjpSLqgZ+X0O/L6k9I0vxbOdGDNDDeNSNPMzXLO2FAJp5VWcx3XphdM THyTLPGwsaIfv4HaSKIsxofE/GHeO3sxFycdOmUOEuDQgZUPr+etIdo6xUCZ28MQAyB7 TeLZL97qR83woLFIR7ACXwNeGyeyR98bsE3/UicEADYw0igOxvi5aUOyZHWleuY+D4IE Vg+Q0T00Fac7Qe5jLwDrlrgwV1dkYXq+vBx2/CLyhiejxcZyr+F3uoxlTS9xVYaODrrQ z1Rcn+QEYpiEpDJODk7Z+4ujkMGptQM9s2kaBe5LWE2MKegpGtmbfmoQUVmGo5TW8ozt zTXA== X-Gm-Message-State: ALoCoQlEFMJySnqeRLHcLqMC0uIJelGhGKOwsKuOSiF45SrL/hfwxpEZn7XG0Qk70FarQNL5WD04 X-Received: by 10.67.4.197 with SMTP id cg5mr13699099pad.10.1376090810881; Fri, 09 Aug 2013 16:26:50 -0700 (PDT) Received: from rfranz-i7.local (c-24-10-48-230.hsd1.ca.comcast.net. [24.10.48.230]) by mx.google.com with ESMTPSA id ue9sm24823913pab.7.2013.08.09.16.26.49 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 16:26:50 -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 14/16] Add strstr to compressed string.c for ARM. Date: Fri, 9 Aug 2013 16:26:15 -0700 Message-Id: <1376090777-20090-15-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1376090777-20090-1-git-send-email-roy.franz@linaro.org> References: <1376090777-20090-1-git-send-email-roy.franz@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130809_162715_284338_203568ED X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: 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=-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)