From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/5] dtoc: Correct the type widening code in fdt_fallback
Date: Fri, 22 Jul 2016 09:22:49 -0600 [thread overview]
Message-ID: <1469200969-4643-5-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1469200969-4643-1-git-send-email-sjg@chromium.org>
This code does not match the fdt version in fdt.py. When dtoc is unable to
use the Python libfdt library, it uses the fallback version, which does not
widen arrays correctly.
Fix this to avoid a warning 'excess elements in array initialize' in
dt-platdata.c which happens on some platforms.
Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---
tools/dtoc/fdt_fallback.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tools/dtoc/fdt_fallback.py b/tools/dtoc/fdt_fallback.py
index 14decf3..9ed11e4 100644
--- a/tools/dtoc/fdt_fallback.py
+++ b/tools/dtoc/fdt_fallback.py
@@ -71,6 +71,12 @@ class Prop:
if type(newprop.value) == list and type(self.value) != list:
self.value = newprop.value
+ if type(self.value) == list and len(newprop.value) > len(self.value):
+ val = fdt_util.GetEmpty(self.type)
+ while len(self.value) < len(newprop.value):
+ self.value.append(val)
+
+
class Node:
"""A device tree node
--
2.8.0.rc3.226.g39d4020
next prev parent reply other threads:[~2016-07-22 15:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 15:22 [U-Boot] [PATCH 1/5] sandbox: Add instructions about building on 32-bit machines Simon Glass
2016-07-22 15:22 ` [U-Boot] [PATCH 2/5] lzmadec: Use the same type as the lzma call Simon Glass
2016-07-22 22:04 ` Tom Rini
2016-07-26 2:32 ` [U-Boot] [U-Boot, " Tom Rini
2016-07-22 15:22 ` [U-Boot] [PATCH 3/5] part_efi: Fix compiler warning on 32-bit sandbox Simon Glass
2016-07-22 22:05 ` Tom Rini
2016-07-26 2:32 ` [U-Boot] [U-Boot, " Tom Rini
2016-07-22 15:22 ` [U-Boot] [PATCH 4/5] hashtable: " Simon Glass
2016-07-22 22:05 ` Tom Rini
2016-07-26 2:32 ` [U-Boot] [U-Boot, " Tom Rini
2016-07-22 15:22 ` Simon Glass [this message]
2016-07-22 22:05 ` [U-Boot] [PATCH 5/5] dtoc: Correct the type widening code in fdt_fallback Tom Rini
2016-07-26 2:33 ` [U-Boot] [U-Boot, " Tom Rini
2016-07-22 22:04 ` [U-Boot] [PATCH 1/5] sandbox: Add instructions about building on 32-bit machines Tom Rini
2016-07-26 2:32 ` [U-Boot] [U-Boot, " Tom Rini
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=1469200969-4643-5-git-send-email-sjg@chromium.org \
--to=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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