summaryrefslogtreecommitdiff
path: root/tools/dtoc/dtb_platdata.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-17 22:00:32 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:58 -0600
commit1953ce75312ab50988f2c81f7250c99dfc2ed52b (patch)
treeedee935039fbbce8c7695c1513b847cadb54a079 /tools/dtoc/dtb_platdata.py
parent90a8132f4de673dbb35ffee265df93b32d6582ca (diff)
dtoc: Sort platdata output from dtoc
At present the order of struct field emitted by this tool depends on the internal workings of a Python dictionary. Sort the fields to remove this uncertainty, so that tests are deterministic. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc/dtb_platdata.py')
-rw-r--r--tools/dtoc/dtb_platdata.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py
index 4aeeab6fba..3b66af8df7 100644
--- a/tools/dtoc/dtb_platdata.py
+++ b/tools/dtoc/dtb_platdata.py
@@ -464,7 +464,8 @@ class DtbPlatdata(object):
var_name = conv_name_to_c(node.name)
self.buf('static const struct %s%s %s%s = {\n' %
(STRUCT_PREFIX, struct_name, VAL_PREFIX, var_name))
- for pname, prop in node.props.items():
+ for pname in sorted(node.props):
+ prop = node.props[pname]
if pname in PROP_IGNORE_LIST or pname[0] == '#':
continue
member_name = conv_name_to_c(prop.name)