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:
@@ -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))
|
||||
|
Reference in New Issue
Block a user