From patchwork Thu Feb 11 23:06:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 61813 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp490054lbl; Thu, 11 Feb 2016 15:08:09 -0800 (PST) X-Received: by 10.98.73.205 with SMTP id r74mr70841493pfi.118.1455232088913; Thu, 11 Feb 2016 15:08:08 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id pz7si15308900pab.216.2016.02.11.15.08.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 15:08:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aU0KG-0005q1-Rk; Thu, 11 Feb 2016 23:07:04 +0000 Received: from mail-oi0-f53.google.com ([209.85.218.53]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aU0KC-0005mS-Ee for linux-arm-kernel@lists.infradead.org; Thu, 11 Feb 2016 23:07:01 +0000 Received: by mail-oi0-f53.google.com with SMTP id m82so841821oif.1 for ; Thu, 11 Feb 2016 15:06:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=eeanZ9ltOrVyKApQklEVrjnN03DqIK9njumH33o6y0Y=; b=BPmDunzSHLYFNh9L59bOdvtTJp7rY/V4UukqHHM/WMV9ds+JEQmjSAuYroA+NMgEfr aK8Ut4up3i6mTp9RJZEEuFkD2tjmo9VGmMO+t9652ARzUbUse2cKDwV+sFv5PZDzGiDV m01B7OQdPhgNiWQf9lHsBvUYIkQRIZDOlTrwPoTJswx40Jg/IR2wiGPxHgPaG5yYcU0x nNmbbFYPLBVPgv34oejaGWOrAvBuCskm1QQwJOlS0YdknLMlvGZ3X6uDJzMZRMwoeykX uXV5CbMXbMq6ueT0ptZpG9yJfM0gZOrj+6Ompblk2BF5jL9OnQ6W7sf8Ceb7/wQ2GTko GCpg== X-Gm-Message-State: AG10YOTmqmuIl15y4pLxOGTbtVwvaFdV6U1YBpMTRPdEm05+dTD3N8IfAcg1bTvAzLjXcw== X-Received: by 10.202.2.8 with SMTP id 8mr221799oic.80.1455231999292; Thu, 11 Feb 2016 15:06:39 -0800 (PST) Received: from rob-hp-laptop.herring.priv (72-48-98-129.dyn.grandenetworks.net. [72.48.98.129]) by smtp.googlemail.com with ESMTPSA id zv7sm2200436obc.13.2016.02.11.15.06.38 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Feb 2016 15:06:38 -0800 (PST) From: Rob Herring To: Russell King Subject: [PATCH] ARM: boot: Add an implementation of strnlen for libfdt Date: Thu, 11 Feb 2016 17:06:34 -0600 Message-Id: <1455231994-12048-1-git-send-email-robh@kernel.org> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160211_150700_599144_FB69639B X-CRM114-Status: GOOD ( 10.99 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.218.53 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.218.53 listed in wl.mailspike.net] 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (robherring2[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (robherring2[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 0.0 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Recent versions of libfdt add a dependency on strnlen. Copy the implementation in lib/string.c here, so we can update libfdt. Signed-off-by: Rob Herring --- Russell, I have a pending libfdt update, so I'd like to take this thru the DT tree with your ack. Rob arch/arm/boot/compressed/string.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/boot/compressed/string.c b/arch/arm/boot/compressed/string.c index 36e53ef..6894674 100644 --- a/arch/arm/boot/compressed/string.c +++ b/arch/arm/boot/compressed/string.c @@ -65,6 +65,15 @@ size_t strlen(const char *s) return sc - s; } +size_t strnlen(const char *s, size_t count) +{ + const char *sc; + + for (sc = s; count-- && *sc != '\0'; ++sc) + /* nothing */; + return sc - s; +} + int memcmp(const void *cs, const void *ct, size_t count) { const unsigned char *su1 = cs, *su2 = ct, *end = su1 + count;