From patchwork Thu Mar 1 15:26:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 130245 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2937320edc; Thu, 1 Mar 2018 07:27:07 -0800 (PST) X-Google-Smtp-Source: AG47ELturiTpdrcDUBkFs2q40dxAaqcoeZwhSGDYZ/XbermAvX3CFuis6UY99smwyIpTdrn+/LlM X-Received: by 10.101.73.139 with SMTP id r11mr1868242pgs.322.1519918027190; Thu, 01 Mar 2018 07:27:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918027; cv=none; d=google.com; s=arc-20160816; b=NTquGp6BHT41LuHC4YIFwuqA4/P3bR0KwHXXoRsJvjNhwpTvh/6mxpBH2dhzS3FcP+ k+XmksWRyVCpuvj7s/lUrhmdGchD8Cw+laKWrcMMttwY3smrXNruJGi2NQVtJH8dpkAn LNTaezGdtxc50VCb3Lfu6VDeplIgtyjx2Gzv6GLJ6BYh+fY/DdJ+e3Ij+9JQX5s0kdLg fe3pp8VjKY4o7B/fYeD/Zl1aqQYGGZ2KH+BtaxmHHDIFFMO538OhRFlDurVGTnwmLipD CAZicmLF74xrbDrRuOgah8TapjStgvzY4lc0q1qtL3VzJDxa1oRvx7E+CP0PI4GyXKXG w7FQ== 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=7jCcbiTt2VSDWrazv9OQ2wOGEWMFnIolnB61g/LClvo=; b=xnJT/o+7faQhPy8kO2fJY2cjxyYiRgds6uJjkXRFbV2tooqLhIS+hWHCq0+gXs2zBW Y+L+QtuBZ1SN/MYxQ+uhX5Li/bQljOVqR9kYFt+va3gOsnCKwpzDkiwdwa7voI7D/hCH W4WO6dCaHmO6I5Ougq9rvTIuChITRTPJhQfHm8lUdD3bDF/6FtvtdGU9NsdbgU7yPClp zSdAHX4gY/72TyV1sX8h/QDtvBfZ0/WbsGV0cdsgXfXg3gDemQ6SLrMMkIX7h26WtT6B tvZcdaH+yPnjcX2zH6AT8zD6m89XUQ+WpE/9oB8ZChI77m5clPp4mb5Z55jlVclwAY2h geAg== 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 f13-v6si3357923plm.188.2018.03.01.07.27.06; Thu, 01 Mar 2018 07:27:07 -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 S1032139AbeCAP07 (ORCPT + 28 others); Thu, 1 Mar 2018 10:26:59 -0500 Received: from mail-ot0-f193.google.com ([74.125.82.193]:34827 "EHLO mail-ot0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032010AbeCAP04 (ORCPT ); Thu, 1 Mar 2018 10:26:56 -0500 Received: by mail-ot0-f193.google.com with SMTP id w2so5901639otg.2 for ; Thu, 01 Mar 2018 07:26:56 -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=7jCcbiTt2VSDWrazv9OQ2wOGEWMFnIolnB61g/LClvo=; b=p1DUpgcd8kMGs5eWZqyUc2UuxgtBSaP3Idi5zBKP/Tz4ELXm2U18+BCtI2Pa9x+yqL sM70mtWWWooN8D6l4amGUajdd2Uv+gzhyMEeBLNleXV1pMPw42fUPzb2xJkP4AUiPrZ0 cyUvgoX1urgJp9RoYXJPgLIzVfevGrtzzKwpTBHWvNzt+ez62vtqPn9amFvHXrDEeNuv UCKN/DpG8F6RabJTGvYBSQ91Cp3fFhdN0yXm2s1pRtheHNl5q88AgXgiBKlnUg1WOtbL VSWOPfrrSjh8PUQVRY9t4bFuWhqo3B561+9gS4iIM7YMhRTgVdFT5a5kGU81X0W1u9Mn A2Hg== X-Gm-Message-State: APf1xPCqBaY8maI4T5SqYr2FNTnS0SwBpXR+y0u0nyQ13IwsVO24PLNs ZIeuQLhkL/+88kPnURbyFA== X-Received: by 10.157.9.189 with SMTP id q58mr1533997otd.366.1519918015751; Thu, 01 Mar 2018 07:26:55 -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 l22sm2409433otb.10.2018.03.01.07.26.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 07:26:55 -0800 (PST) From: Rob Herring To: Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Benjamin Herrenschmidt , Paul Mackerras Subject: [PATCH] powerpc: boot: add strrchr function Date: Thu, 1 Mar 2018 09:26:54 -0600 Message-Id: <20180301152654.29275-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. Most of the string functions are in assembly, but stdio.c already has strnlen, so add strrchr there. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Signed-off-by: Rob Herring --- Please ack. This is a dependency for dtc/libfdt sync with upstream. arch/powerpc/boot/stdio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) -- 2.14.1 Acked-by: Michael Ellerman diff --git a/arch/powerpc/boot/stdio.c b/arch/powerpc/boot/stdio.c index a701261b1781..98042eff7b26 100644 --- a/arch/powerpc/boot/stdio.c +++ b/arch/powerpc/boot/stdio.c @@ -21,6 +21,16 @@ size_t strnlen(const char * s, size_t count) return sc - s; } +char *strrchr(const char *s, int c) +{ + const char *last = NULL; + do { + if (*s == (char)c) + last = s; + } while (*s++); + return (char *)last; +} + #ifdef __powerpc64__ # define do_div(n, base) ({ \