From patchwork Wed Feb 5 17:03:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 24196 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f72.google.com (mail-qa0-f72.google.com [209.85.216.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5074D20675 for ; Wed, 5 Feb 2014 17:05:41 +0000 (UTC) Received: by mail-qa0-f72.google.com with SMTP id f11sf1173209qae.3 for ; Wed, 05 Feb 2014 09:05:40 -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=bXBAfASFLfo/GCu05fkbiBy/OKcXkPlBLSiTd9QZBBI=; b=XFItg/OUKRxMee+SwvgRVrxkfm738i+qkY5jz7Qh10SLRoBCC0jU/fRNItWWL0BQxi 7HrCyps+0RlBGFeJ7LL/T1SMGbI7enjCXrUP+8VnPiUfZIjd1LlkQ/9GoD/SxQtWjU+7 1jc0GfOTYkqtQZN7r57/JtbFGwKLiNweAeis7iDrCzGunBK7OM4I1D6HSBUIOMd5tMXh xhTA0dvu1QJ/T99J6mZJrC/lnainj7wFHnC11ttM9C4Pj+cETwTJ54ZTm2gd6viAJCb0 B/JiKxJWVuEZszLEJsKwz2WlUkRLnhYev/7gbJ89o23UaBvKVN/oiutFl7YgXHIyr12q Ps+A== X-Gm-Message-State: ALoCoQk6kR9cvR8Nn665Pd0P6sLLW1EWgHOUcjdv435eaS1EmrDqyeorSH42fFUOqPKVdSPimLs+ X-Received: by 10.236.149.198 with SMTP id x46mr2653243yhj.7.1391619940368; Wed, 05 Feb 2014 09:05:40 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.27.239 with SMTP id 102ls212077qgx.23.gmail; Wed, 05 Feb 2014 09:05:40 -0800 (PST) X-Received: by 10.220.131.210 with SMTP id y18mr1773031vcs.12.1391619940243; Wed, 05 Feb 2014 09:05:40 -0800 (PST) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id uh1si9870600vcb.25.2014.02.05.09.05.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:40 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id db12so524514veb.39 for ; Wed, 05 Feb 2014 09:05:40 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr1765374vcb.0.1391619940168; Wed, 05 Feb 2014 09:05:40 -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 u4csp64606vcz; Wed, 5 Feb 2014 09:05:39 -0800 (PST) X-Received: by 10.194.2.70 with SMTP id 6mr2178307wjs.25.1391619921370; Wed, 05 Feb 2014 09:05:21 -0800 (PST) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by mx.google.com with ESMTPS id hi2si15461160wjc.149.2014.02.05.09.05.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 05 Feb 2014 09:05:21 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.179 is neither permitted nor denied by best guess record for domain of leif.lindholm@linaro.org) client-ip=209.85.212.179; Received: by mail-wi0-f179.google.com with SMTP id hn9so767309wib.6 for ; Wed, 05 Feb 2014 09:05:20 -0800 (PST) X-Received: by 10.180.96.102 with SMTP id dr6mr13425077wib.61.1391619920687; Wed, 05 Feb 2014 09:05:20 -0800 (PST) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id p1sm47427211wie.1.2014.02.05.09.05.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Feb 2014 09:05:19 -0800 (PST) From: Leif Lindholm To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org Cc: patches@linaro.org, Roy Franz , Leif Lindholm Subject: [PATCH 08/22] Add strstr to compressed string.c for ARM. Date: Wed, 5 Feb 2014 17:03:59 +0000 Message-Id: <1391619853-10601-9-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.org> References: <1391619853-10601-1-git-send-email-leif.lindholm@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: leif.lindholm@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.180 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: , From: Roy Franz The shared efi-stub-helper.c functions require a strstr implementation. The EFI stub is part of the decompressor, so it does not use the kernel strstr() implementation. This patch adds a strstr() implementation to the string.c file for the decompressor, with the implementation copied from the arch/x86/boot/string.c file used by the x86 decompressor. Signed-off-by: Roy Franz Signed-off-by: Leif Lindholm 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)