From patchwork Fri Jul 18 14:00:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 4585081 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 540259F26C for ; Fri, 18 Jul 2014 14:04:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9641220179 for ; Fri, 18 Jul 2014 14:04:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AAFBA20117 for ; Fri, 18 Jul 2014 14:04:21 +0000 (UTC) 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 1X88jq-0005na-IC; Fri, 18 Jul 2014 14:02:18 +0000 Received: from mail-wg0-f41.google.com ([74.125.82.41]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X88ix-0004zk-Iv for linux-arm-kernel@lists.infradead.org; Fri, 18 Jul 2014 14:01:24 +0000 Received: by mail-wg0-f41.google.com with SMTP id z12so3598662wgg.24 for ; Fri, 18 Jul 2014 07:00:59 -0700 (PDT) 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:in-reply-to :references; bh=hMLJyaSAjt4FTFNlzHmDPjWYDLJMQkQnZFHRCdygg18=; b=YDeqLm94Kji7nwiUMwwu+ebgvz/4KW3G5YQ+FAnyFQbIHs2HuhArAUc8PSbUUWgN5l Pwu6E6hXNbqj+GlL5Lb1HP/AWv3qTXpNaPKr5AMSKugCvB/2loV5wEOU2khoHj30X3sl emymDFektfu9TVwqSzBHbLJaObH+v2ZykjC7TpLpMfmkYoszLy8AsR0GmZRJjKFJPhrI bmIBWPFHSmTwB1mdhJUyvISsjFITBuSDndUImg9uXeU/fav3FDJ3u90/H292G+SQxVSS rEklPaR1mJiWprWUINdpXKVlzB+MwRAEIhfzH1S6h7UwW7Ub1KD78hyM6SQ6hEoBNXK5 8UZg== X-Gm-Message-State: ALoCoQm9mou6YSTr5hjVcdXMgzSs+tRYpGuCNZpq96yPdkitZdBq66yBgTR+Xj8OuH2gA09QdPoQ X-Received: by 10.194.59.49 with SMTP id w17mr6630657wjq.135.1405692059705; Fri, 18 Jul 2014 07:00:59 -0700 (PDT) Received: from mohikan.mushroom.smurfnet.nu (cpc4-cmbg17-2-0-cust71.5-4.cable.virginm.net. [86.14.224.72]) by mx.google.com with ESMTPSA id ft17sm14465308wjc.14.2014.07.18.07.00.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Jul 2014 07:00:59 -0700 (PDT) From: Leif Lindholm To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, linux@arm.linux.org.uk Subject: [PATCH 5/7] arm: efi: use strcmp instead of strncmp for fdt parsing Date: Fri, 18 Jul 2014 15:00:51 +0100 Message-Id: <1405692053-7514-6-git-send-email-leif.lindholm@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1405692053-7514-1-git-send-email-leif.lindholm@linaro.org> References: <1405692053-7514-1-git-send-email-leif.lindholm@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140718_070123_813860_21A6CCF1 X-CRM114-Status: GOOD ( 11.54 ) X-Spam-Score: -0.7 (/) Cc: roy.franz@linaro.org, matt.fleming@intel.com, ard.biesheuvel@linaro.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The existing shared EFI arm/arm64 stub code uses strncmp when parsing the device tree. Since this function is missing from arm zImage, use strcmp instead, rather than growing the zImage further. Signed-off-by: Leif Lindholm --- drivers/firmware/efi/libstub/fdt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c index a56bb35..399374b 100644 --- a/drivers/firmware/efi/libstub/fdt.c +++ b/drivers/firmware/efi/libstub/fdt.c @@ -58,14 +58,13 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, prev = 0; for (;;) { const char *type; - int len; node = fdt_next_node(fdt, prev, NULL); if (node < 0) break; - type = fdt_getprop(fdt, node, "device_type", &len); - if (type && strncmp(type, "memory", len) == 0) { + type = fdt_getprop(fdt, node, "device_type", NULL); + if (type && strcmp(type, "memory") == 0) { fdt_del_node(fdt, node); continue; }