From patchwork Sun Jul 15 02:44:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Domenico Andreoli X-Patchwork-Id: 1198371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 39A70DF28C for ; Sun, 15 Jul 2012 02:58:24 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SqExc-0001HZ-VB; Sun, 15 Jul 2012 02:53:29 +0000 Received: from mail-we0-f177.google.com ([74.125.82.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SqEqd-0008VJ-Fd for linux-arm-kernel@lists.infradead.org; Sun, 15 Jul 2012 02:46:34 +0000 Received: by weyr3 with SMTP id r3so3441828wey.36 for ; Sat, 14 Jul 2012 19:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:user-agent:date:from:to:cc:subject:references :content-disposition; bh=3gxngvsTCmQL9+z0QH894ntfb0xCDAjZCWYdzvZ9fZY=; b=0cdbSFhVQumJ1uzReztURlUBto99coIvyzXhYR+mb/NrfFx5XnZB6P9wPHCFDtnmU/ n6V1+m/I2GBYxEylxqA/y2ddRPhLih0wcTyf/rxPQaUgXFpKq3A3qSdc2XxpZ6i7558G atDkzBWLZoRvrlB7mqBO+EDD7UDm/dmx7Su0cssP11ca5T5ZfUbbedhMITeTUCFAauIP L4R5uXxUNLlkaB8KMPAPucj2pGzDsQnz+bLEO6x8SdDqmZHjz8lbcT7U5mACDq8AF6+G crw8zH+bL1CTwK4jjjrkdeXe7W9sT4//H1lNIk5ZOCtDtcYJJSiM5NxBJYcu4vuDoXeU VtCg== Received: by 10.216.211.131 with SMTP id w3mr3291668weo.163.1342320369410; Sat, 14 Jul 2012 19:46:09 -0700 (PDT) Received: from raptus.dandreoli.com (178-85-163-250.dynamic.upc.nl. [178.85.163.250]) by mx.google.com with ESMTPS id fu3sm19283812wib.10.2012.07.14.19.46.08 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jul 2012 19:46:08 -0700 (PDT) Received: by raptus.dandreoli.com (Postfix, from userid 1000) id 85D9737B9FE; Sun, 15 Jul 2012 04:46:08 +0200 (CEST) Message-Id: <20120715024608.227203804@gmail.com> User-Agent: quilt/0.60-1 Date: Sun, 15 Jul 2012 04:44:09 +0200 From: Domenico Andreoli To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 01/12] ARM: Add strstr to the decompressor References: <20120715024408.747946928@gmail.com> Content-Disposition: inline; filename=decomp-add-strstr.patch X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (cavokz[at]gmail.com) -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.177 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Domenico Andreoli , Russell King - ARM Linux , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Domenico Andreoli This is a classic that doesn't need presentations, it comes directly from lib/string.c so the credits are not mine at all. We use it to extract the console device name from the kernel command line. Signed-off-by: Domenico Andreoli --- arch/arm/boot/compressed/string.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) Index: b/arch/arm/boot/compressed/string.c =================================================================== --- a/arch/arm/boot/compressed/string.c +++ b/arch/arm/boot/compressed/string.c @@ -93,6 +93,23 @@ int strcmp(const char *cs, const char *c return res; } +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; +} + void *memchr(const void *s, int c, size_t count) { const unsigned char *p = s;