Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1640870

[PATCH 1/2] fdt: correctly handle uncompressed node names

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Sascha Silbe <x-linux@infra-silbe.de>
Newsgroups linux.kernel
Subject [PATCH 1/2] fdt: correctly handle uncompressed node names
Date Sat, 13 May 2017 12:40:01 +0200
Message-ID <tGCCR-2pX-5@gated-at.bofh.it> (permalink)
References <tGCCR-2pX-7@gated-at.bofh.it>
X-Original-To Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>
X-Mailer git-send-email 2.11.0
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 24
Organization linux.* mail to news gateway
X-Original-Cc devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Sat, 13 May 2017 12:22:28 +0200
X-Original-Message-ID <20170513102229.22579-2-x-linux@infra-silbe.de>
X-Original-References <20170513102229.22579-1-x-linux@infra-silbe.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1640870

Show key headers only | View raw


When handling uncompressed node names, we need to compare the last
component rather than the entire string.

Signed-off-by: Sascha Silbe <x-linux@infra-silbe.de>
---
 scripts/dtc/libfdt/fdt_ro.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/scripts/dtc/libfdt/fdt_ro.c b/scripts/dtc/libfdt/fdt_ro.c
index 3d00d2eee0e3..ca03ff87429c 100644
--- a/scripts/dtc/libfdt/fdt_ro.c
+++ b/scripts/dtc/libfdt/fdt_ro.c
@@ -64,6 +64,9 @@ static int _fdt_nodename_eq(const void *fdt, int offset,
 		/* short match */
 		return 0;
 
+	if (*p == '/')
+		/* Uncompressed node name. Only compare the last part. */
+		p = strrchr(p, '/') + 1;
 	if (memcmp(p, s, len) != 0)
 		return 0;
 
-- 
2.11.0

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] fdt: correctly handle uncompressed node names Sascha Silbe <x-linux@infra-silbe.de> - 2017-05-13 12:40 +0200
  Re: [PATCH 1/2] fdt: correctly handle uncompressed node names kbuild test robot <lkp@intel.com> - 2017-05-13 14:40 +0200
  Re: [PATCH 1/2] fdt: correctly handle uncompressed node names Rob Herring <robh+dt@kernel.org> - 2017-05-15 17:30 +0200

csiph-web