From patchwork Thu Mar 1 15:25:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 130264 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2950483edc; Thu, 1 Mar 2018 07:36:55 -0800 (PST) X-Google-Smtp-Source: AG47ELv4PcpNuXe0n7Wrj2FtOg3HkqUVWM815ku3YOMHUlyO/THdPzjM2OtDeDihDwfWYkctOrQn X-Received: by 10.99.116.25 with SMTP id p25mr1886568pgc.109.1519918615573; Thu, 01 Mar 2018 07:36:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918615; cv=none; d=google.com; s=arc-20160816; b=p7g4GCNCYnruR5By+tqoZBT+pwnUAtMtBjEnWQ+edvCX5ltfq8LZ1K694WZ4vczIB9 QJUCriaU0XlJ9DKMLS99OQuIYGDoBBUT/GXymgvYdSePORn7JbU2TS7pGkeB9L9r0eum yvB44UookSf15f+IDEhEy1A+4gNV0RR8UaOwanO8ZXQeO87lpc7OlLIiqjZ7yPULV2hC tbjXf1P6CKxJTeMv8i325Q0DBa0gy/gROWOTxNB+KLBvNMcqGR1Vtpq2jq/X/RVzyrnj HeCqV7gLzF+wcsAwuOgBReIZmHii7m46iP6f4hVV4OkqjEILVKj8j8/7ieLxA+C4IGox xomg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=0qffWDzeQnhgOgm8/by8UygPdRWJWSHcL0p264d27ZE=; b=FT7FjThzNg71UMxTYfw8mXT0VIFuZGJ7trdRFdAxvJINhYIwrZ7j3m+OQZSOTh1EK4 y+gYpkDBbRcIcip5T0adDPEdaY2Lm3/+Wy1Syc6MnoRQlLSh26A3TerZfwQ/RFpK8lMN S5ya/NKsDBjm6mKB196aTLbNkngK0vLDsjbryKgTZ2Pr2DwidFT4WSPIDx60qNABntmN 57jZvSN4KuoarTUDrtv7Bd7olHhZ0YJtmselH+B+FBph9urb2BVxEErdvw4TANa7iP3w KOMSO4jVTIs9JsXZ3e0MrQJZde9gyoMQ+5xhC2IA0umO9Jx1wHwtO8+LsYHrlLhF+vYf 6e0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g10-v6si2863008plk.730.2018.03.01.07.36.55; Thu, 01 Mar 2018 07:36:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032488AbeCAPgw (ORCPT + 28 others); Thu, 1 Mar 2018 10:36:52 -0500 Received: from mail-oi0-f66.google.com ([209.85.218.66]:38310 "EHLO mail-oi0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031903AbeCAPZZ (ORCPT ); Thu, 1 Mar 2018 10:25:25 -0500 Received: by mail-oi0-f66.google.com with SMTP id 123so4740482oig.5 for ; Thu, 01 Mar 2018 07:25:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0qffWDzeQnhgOgm8/by8UygPdRWJWSHcL0p264d27ZE=; b=NEddrhq8YN3zvjSX09UJOlTHaj+9gBMpr+mJJweex0pgCFbrdc9331K6WSGIczT994 SLzMjOwA6htsE04PAQKEc8NbfItA61BoeLUF7N/h/Dqcm2gaCHu0JmKyOCADmfqJZpnw ULPKj6IZuO2MpGwemNdfuBUsbRpg3EbvTNSMYqK8y1nQM5lfVMytt7oOX3Yjvaeob947 SNyzjUPuCggPnZYZqNkPVnJpUb0yV+92vVAlhr6H4Bd2VtWP9XeMDur1nx7kf0eFxTi7 k9Bmb+nq3U4UXmt7GDeW+IHspi5Mb5OgGxzAgbTiVYB6cO+OzQyb4UNjdSd1IES1KTIJ P9vQ== X-Gm-Message-State: AElRT7HpvvyWcvjc+Uixxas8IEl1/SzgJTEPgjJTm2mgAcTu1eEpPiFV uHpvw+t9WYyWgyy/+CgnIw== X-Received: by 10.202.219.67 with SMTP id s64mr1394436oig.303.1519917924856; Thu, 01 Mar 2018 07:25:24 -0800 (PST) Received: from xps15.herring.priv (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.googlemail.com with ESMTPSA id t19sm2038662oie.33.2018.03.01.07.25.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 07:25:16 -0800 (PST) From: Rob Herring To: Russell King Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: boot: add strrchr function Date: Thu, 1 Mar 2018 09:25:15 -0600 Message-Id: <20180301152515.27004-1-robh@kernel.org> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org libfdt gained a new dependency on strrchr, so copy the implementation from lib/string.c. Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Rob Herring --- Please ack. This is a dependency for dtc/libfdt sync with upstream. arch/arm/boot/compressed/string.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.14.1 diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c index 13c90abc68d6..ade5079bebbf 100644 --- a/arch/arm/boot/compressed/string.c +++ b/arch/arm/boot/compressed/string.c @@ -121,6 +121,16 @@ char *strchr(const char *s, int c) return (char *)s; } +char *strrchr(const char *s, int c) +{ + const char *last = NULL; + do { + if (*s == (char)c) + last = s; + } while (*s++); + return (char *)last; +} + #undef memset void *memset(void *s, int c, size_t count)