From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org
Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3] Add limited read-only support for older (V2 and V3) device tree to libfdt.
Date: Sun, 21 Jan 2018 20:40:19 +1100 [thread overview]
Message-ID: <20180121094019.GA28199@umbus> (raw)
In-Reply-To: <20180119214803.24934-1-nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1489 bytes --]
On Fri, Jan 19, 2018 at 09:48:03PM +0000, nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org wrote:
> From: Nathan Whitehorn <nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
>
> This can be useful in particular in the kernel when booting on systems
> with FDT-emitting firmware that is out of date. Releases of kexec-tools
> on ppc64 prior to the end of 2014 are notable examples of such.
>
> Signed-off-by: Nathan Whitehorn <nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
> ---
>
> This version of the patch fixes a number of style issues and removes some
> unnecessary redundant code noted in review.
As suggested, please implement the change to use
fdt_get_property_namelen_() in fdt_getprop_namelen(). Plus I spotted
one other bug..
[snip]
> + if (fdt_version(fdt) < 0x10) {
> + /*
> + * For old FDT versions, match the naming conventions of V16:
> + * give only the leaf name (after all /). The actual tree
> + * contents are loosely checked.
> + */
> + const char *leaf;
> + leaf = strrchr(nameptr, '/');
> + if (leaf == NULL) {
> + err = FDT_ERR_BADVALUE;
The error codes are defined positive, but used negative, so this needs
to be err = -FDT_ERR_BADVAULE, Except, actually, I think BADSTRUCTURE
would be a better option.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-01-21 9:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 6:31 [PATCH] Add limited read-only support for older (V2 and V3) device tree to libfdt Nathan Whitehorn
[not found] ` <20171208063149.76523-1-nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2017-12-29 18:12 ` Nathan Whitehorn
[not found] ` <9c383dc9-c8c2-2b65-b527-ffc9b922b7dc-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2018-01-03 0:40 ` David Gibson
[not found] ` <20180103004027.GI24581-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-08 18:33 ` Nathan Whitehorn
2017-12-31 2:28 ` [PATCH v2] " nwhitehorn-h+KGxgPPiopAfugRpC6u6w
[not found] ` <20171231022858.10834-1-nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2018-01-18 4:59 ` David Gibson
[not found] ` <20180118045903.GL30352-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-18 20:41 ` Nathan Whitehorn
[not found] ` <cfa9f549-b63b-3642-32ab-a2e21898d16e-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2018-01-18 23:25 ` David Gibson
[not found] ` <20180118232519.GW30352-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2018-01-19 22:01 ` Nathan Whitehorn
2018-01-19 21:48 ` [PATCH v3] " nwhitehorn-h+KGxgPPiopAfugRpC6u6w
[not found] ` <20180119214803.24934-1-nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2018-01-21 9:40 ` David Gibson [this message]
2018-01-22 19:16 ` Nathan Whitehorn
2018-01-25 5:13 ` [PATCH v4] " nwhitehorn-h+KGxgPPiopAfugRpC6u6w
[not found] ` <20180125051340.22391-1-nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.org>
2018-01-27 7:46 ` David Gibson
2018-01-30 1:05 ` Nathan Whitehorn
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=20180121094019.GA28199@umbus \
--to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
--cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nwhitehorn-h+KGxgPPiopAfugRpC6u6w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).