1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-26 13:01:17 +02:00

dtoc: Avoid very long lines in output

Large arrays can result in lines with hundreds or thousands of characters
which is not very editor-friendly. To avoid this, addjust the tool to
group values 8 per line.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
Simon Glass
2017-08-29 14:15:49 -06:00
parent fbdfd228fb
commit 21d54ac353
2 changed files with 10 additions and 3 deletions

View File

@@ -385,7 +385,12 @@ class DtbPlatdata(object):
else:
for val in prop.value:
vals.append(get_value(prop.type, val))
self.buf(', '.join(vals))
# Put 8 values per line to avoid very long lines.
for i in xrange(0, len(vals), 8):
if i:
self.buf(',\n\t\t')
self.buf(', '.join(vals[i:i + 8]))
self.buf('}')
else:
self.buf(get_value(prop.type, prop.value))