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: 21823 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E09CF23FD2 for ; Wed, 27 Nov 2013 23:32:10 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wm4sf25037711obc.3 for ; Wed, 27 Nov 2013 15:32:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=1HyubkUNXUmWOxSiOxM7s/kKs9krF+9B/0srjjPeJHw=; b=cwyuU45s94XE7aPjkTOfZZWx7UB/suvnZWtXCrdZalLRv7ofOg3igs7cWiLMj2tsO6 cVC6C7vBznQMSusGXt1dNotIV1TOuokBrkRzU2rMdA1CNbdjvjIh6OUtlsTbxZmDrK73 dZYqUM+3V/P565ZQG5F7ESXerhLWjgZUa4Wt+ad5P/H4PRl2+3n6CZlRNzuHZZxuZXeC zaAia5UC0hjEo8Sm7KQj0r7hPX26UqfURCKY9tzgkkTPhbB+m/4EzLXTpsx5b2yEwAnI QMDE+RlFLq46JS9mBF0QGs8bVkvABF/uVVLdEnO/czukHlK05ut1wnb4C+YmpuzM9PaO apaA== X-Gm-Message-State: ALoCoQlj3RRJxbbaxQV/0hB1PDdXy6j6T7eGFEOIpgRn66CFlss2fFmwOw8eT1jj1sfYtm6uo5h5 X-Received: by 10.182.53.165 with SMTP id c5mr13856145obp.0.1385595130502; Wed, 27 Nov 2013 15:32:10 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.132.164 with SMTP id ov4ls1076579qeb.32.gmail; Wed, 27 Nov 2013 15:32:10 -0800 (PST) X-Received: by 10.220.97.145 with SMTP id l17mr1917658vcn.35.1385595130376; Wed, 27 Nov 2013 15:32:10 -0800 (PST) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id dk5si21778138vcb.71.2013.11.27.15.32.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 15:32:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id pa12so5671902veb.33 for ; Wed, 27 Nov 2013 15:32:10 -0800 (PST) X-Received: by 10.58.146.71 with SMTP id ta7mr11336251veb.23.1385595130274; Wed, 27 Nov 2013 15:32:10 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp24571vcz; Wed, 27 Nov 2013 15:32:09 -0800 (PST) X-Received: by 10.50.39.45 with SMTP id m13mr388175igk.14.1385595129709; Wed, 27 Nov 2013 15:32:09 -0800 (PST) Received: from mail-ie0-f178.google.com (mail-ie0-f178.google.com [209.85.223.178]) by mx.google.com with ESMTPS id if8si27603181icb.2.2013.11.27.15.32.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Nov 2013 15:32:09 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.178 is neither permitted nor denied by best guess record for domain of roy.franz@linaro.org) client-ip=209.85.223.178; Received: by mail-ie0-f178.google.com with SMTP id lx4so13065268iec.37 for ; Wed, 27 Nov 2013 15:32:09 -0800 (PST) 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 Cc: leif.lindholm@linaro.org, grant.likely@linaro.org, dave.martin@arm.com, msalter@redhat.com, patches@linaro.org, Roy Franz 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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)