Devicetree
 help / color / mirror / Atom feed
From: Sascha Silbe <x-linux@infra-silbe.de>
To: Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] fdt: correctly handle uncompressed node names
Date: Sat, 13 May 2017 12:22:28 +0200	[thread overview]
Message-ID: <20170513102229.22579-2-x-linux@infra-silbe.de> (raw)
In-Reply-To: <20170513102229.22579-1-x-linux@infra-silbe.de>

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

  reply	other threads:[~2017-05-13 10:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 10:22 [PATCH 0/2] FDT fixes for running on native Open Firmware Sascha Silbe
2017-05-13 10:22 ` Sascha Silbe [this message]
     [not found]   ` <20170513102229.22579-2-x-linux-XAdK+dDVA0n/cwiKa4OQEw@public.gmane.org>
2017-05-13 12:35     ` [PATCH 1/2] fdt: correctly handle uncompressed node names kbuild test robot
2017-05-13 13:07     ` kbuild test robot
2017-05-15 15:19   ` Rob Herring
2017-05-13 10:22 ` [PATCH 2/2] of: fdt: fix unflattening of FDTs containing uncompressed paths Sascha Silbe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170513102229.22579-2-x-linux@infra-silbe.de \
    --to=x-linux@infra-silbe.de \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox