From patchwork Thu Mar 1 15:27:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 130246 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2938219edc; Thu, 1 Mar 2018 07:27:51 -0800 (PST) X-Google-Smtp-Source: AG47ELtLrupy8MjSNpOaEWFe61E+F1095KFeQjdAGZVis+pBqLOTp8DDXzKikaKWktxHaVbTXtjx X-Received: by 2002:a17:902:5682:: with SMTP id j2-v6mr2233865pli.441.1519918071654; Thu, 01 Mar 2018 07:27:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519918071; cv=none; d=google.com; s=arc-20160816; b=JE1kTt3dgHV5WXJ/1RcAL1qjHwdagt2f2Bj1BBPn4pAogP0zjx7JGcimXMsW2i28rF qPDn8WBptwTMl+h2jFRB4yyOmJOnQzR6Yb92eYBvCl01uQMOETj0W/1Q7i+WYiS0xAr1 6Nsw4+hLGrrRe7v2kcDZW6uliniif4XoO+MlRUMeBHV61Xo9mZJ1pfk6gP5UC2h2v6Zh 2EdrtK22KDvJDwE3xo7QAEn51MH9Xpi6kdlG1rG6ANotvkCCQKxer+U2/G0RDw/Vn/cd lKc/JNVxNFzwaBmhVJ/peDqUkV0Lv6boc+y2WhVIse7XoMI1iPKNLZiahrR+Nla22a69 HWAw== 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=ao47Y7j21wo53lHw5gEejnUy9+j+B1F07ta8SPMRT9k=; b=G7A+6qUQmkM+ImgIOzUS1QzxqZIs6Q6XSh1tTjH5+yhOWDR9o9pZSaF88h4AQV/oZg 2U8x+3SaJFScKPTauGsAky7118VBAQts0+XhqpsttRk0UHRuicKyuTJR3PFXcADQNOu1 y/OPnITYjLk9whW+x4lah4hWvWs+KQUd3cOObDkIRpAJHhGlEGAnNGTUfJO/171W5NE+ s2vxnlqJxJ27qosORJFdRMULLo59Qd2EdH9aAx7nCP518D+qB0FE75MDmPzMIotxct7+ 3tgwp9nKSIHpifVd3e3Abct/vHcfO/cHlhcC2N3Ha7tcw226QUfvIWsqQ5EcysiIrWZw 3HBA== 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 i63si3155514pfj.365.2018.03.01.07.27.51; Thu, 01 Mar 2018 07:27:51 -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 S1032156AbeCAP1s (ORCPT + 28 others); Thu, 1 Mar 2018 10:27:48 -0500 Received: from mail-ot0-f195.google.com ([74.125.82.195]:33324 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032087AbeCAP1q (ORCPT ); Thu, 1 Mar 2018 10:27:46 -0500 Received: by mail-ot0-f195.google.com with SMTP id y11so5926260otg.0 for ; Thu, 01 Mar 2018 07:27:45 -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=ao47Y7j21wo53lHw5gEejnUy9+j+B1F07ta8SPMRT9k=; b=BaTbFHBbxs79fZYe0tP8pe7+Egxr2P0n/Pz/EnC0OFMHvvs5ZCxE5pJYfdo4DBMELs E/eHbQefLtq+7+Barw+Pe2opbOoYW6MfD9h6VeXmeAGQ2Vtso46wB7DZiCET3rgedlGc db8P62Omui80Pb98CnDAnpJxZYMHXo1x7z/qYLNenuaqGzkUXNP0OtB3SDMXSvWceMzI Pc81qIk8g8vBK7H9k5W4HBLz1jMz46TyOgpl8zO4oU9OEVIhfHeJrEVhxJ8ikCPrt4Ef 3gTkJxuwvkm9hn7/2+TTINI5E+QTPnsnTEpM4fpzNHPAWltgDQ7MIaok29B2SyxCV55f N0Pw== X-Gm-Message-State: APf1xPBMYh5g34NOf5lzZAMYMI6aENb3gcsBuT0IbK0khUcx7KFK8znz u9PQ9yzdNGB9zeMjjazfmQ== X-Received: by 10.157.68.133 with SMTP id v5mr1708150ote.342.1519918065559; Thu, 01 Mar 2018 07:27:45 -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 m130sm1981306oif.20.2018.03.01.07.27.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 07:27:44 -0800 (PST) From: Rob Herring To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org Subject: [PATCH] efi/libstub: add strrchr function Date: Thu, 1 Mar 2018 09:27:44 -0600 Message-Id: <20180301152744.30718-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: Ard Biesheuvel Signed-off-by: Rob Herring --- Please ack. This is a dependency for dtc/libfdt sync with upstream. drivers/firmware/efi/libstub/string.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.14.1 Acked-by: Ard Biesheuvel diff --git a/drivers/firmware/efi/libstub/string.c b/drivers/firmware/efi/libstub/string.c index ed10e3f602c5..c1a7e58a5af7 100644 --- a/drivers/firmware/efi/libstub/string.c +++ b/drivers/firmware/efi/libstub/string.c @@ -56,3 +56,20 @@ int strncmp(const char *cs, const char *ct, size_t count) return 0; } #endif + +#ifndef __HAVE_ARCH_STRRCHR +/** + * strrchr - Find the last occurrence of a character in a string + * @s: The string to be searched + * @c: The character to search for + */ +char *strrchr(const char *s, int c) +{ + const char *last = NULL; + do { + if (*s == (char)c) + last = s; + } while (*s++); + return (char *)last; +} +#endif