From patchwork Tue Aug 29 20:15:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 807270 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="nUMQCFhb"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xhg2c4bz2z9sR9 for ; Wed, 30 Aug 2017 06:19:04 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4F77FC226AE; Tue, 29 Aug 2017 20:17:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 134C3C225F0; Tue, 29 Aug 2017 20:16:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 1922DC22602; Tue, 29 Aug 2017 20:16:18 +0000 (UTC) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by lists.denx.de (Postfix) with ESMTPS id 43963C22455 for ; Tue, 29 Aug 2017 20:16:15 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id k77so36400153oib.2 for ; Tue, 29 Aug 2017 13:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=VLkYkWx3bjbErVKmAZikiJnqX3U9hVOFxdBRwJnUeTg=; b=nUMQCFhb/lmcb4iF0/OvWElSBVtYgbRx20T5zruS0kSaJLyCksTkfUtyWudN/2/MXz CqQQ6bHWyfxXuUa9f0C/G26Hou71NnYNaI+kbV4YlZr1/u4GBru+bFzGgf4cOOx+nOw1 ribZ30LwQJqKVfFq1yhtc7OdWeLHHzC+NOw44hFbIG5m2VC4GzDepb7H6iQ5SmfrYcnx 0WVpakD5BD/ZQDfjKQxRf7/sUOsRcU0BsPSE7lU5/duZ90eZg+25Y45oRqoLeESPP+/0 kbFlQ11+AxoulCLOIlzN094lN11JvmQRdZFf9eje2UJgoInluhL7eZppviO6K6cdSsEI nNyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=VLkYkWx3bjbErVKmAZikiJnqX3U9hVOFxdBRwJnUeTg=; b=Z+v6ZxOFXuRkRK/m3UIayOc6XmkcJaviOcMRPkkTWp7olr0q+7c5ZzjctL13jyfh7z OHxROg0nlFXXLQsvRboO1yq+lKRw3kjsCYSQq8d5Kvr7AggbL9SY8yEmAWagGLzAwzIs tuiqJPBzys+3jpmrjh49wXNBJ1Zh4A/sxeWM54Y141g+/sOamzHoViZE3OzETdef8Oue 1C3BXpDdh34HKGeu3EoZ8OVVpEk4vwQlcUjIjnYiMjOz+B7UIzCfhN+M7M76Lb4/O8bi UqO/BP63hkXw8i06ZgZIwfpHYFp7IO+67QCA4gzaquZfO84HaqN0m4D4yPlpvxkb55+Q 8Lkw== X-Gm-Message-State: AHYfb5jXO5JBlUBOIFBwE8p40pYHfGAGrat9ZLNHmW+0iT++byqVunds hWo+xI0dkn90gtu4oUSnVw== X-Google-Smtp-Source: ADKCNb4xeqXckYzmtG6fAdYD5celWIa64JQtvU9jCdV9PmaM5HXxNi6TiE9cFXnYMUC4B5wtA0Zo+g== X-Received: by 10.202.199.198 with SMTP id x189mr1494720oif.279.1504037773656; Tue, 29 Aug 2017 13:16:13 -0700 (PDT) Received: from kiwi.bld.corp.google.com ([100.101.164.89]) by smtp.gmail.com with ESMTPSA id o7sm3248850oia.44.2017.08.29.13.16.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2017 13:16:12 -0700 (PDT) Received: by kiwi.bld.corp.google.com (Postfix, from userid 121222) id C9B6E13FCAB; Tue, 29 Aug 2017 14:16:10 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 29 Aug 2017 14:15:49 -0600 Message-Id: <20170829201601.64312-5-sjg@chromium.org> X-Mailer: git-send-email 2.14.1.342.g6490525c54-goog In-Reply-To: <20170829201601.64312-1-sjg@chromium.org> References: <20170829201601.64312-1-sjg@chromium.org> Cc: Tom Rini Subject: [U-Boot] [PATCH v2 04/16] dtoc: Avoid very long lines in output X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Signed-off-by: Simon Glass --- Changes in v2: None tools/dtoc/dtb_platdata.py | 7 ++++++- tools/dtoc/test_dtoc.py | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/dtoc/dtb_platdata.py b/tools/dtoc/dtb_platdata.py index 4a1162a9fa..3243bccfe8 100644 --- a/tools/dtoc/dtb_platdata.py +++ b/tools/dtoc/dtb_platdata.py @@ -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)) diff --git a/tools/dtoc/test_dtoc.py b/tools/dtoc/test_dtoc.py index 8b95c4124f..5040f23325 100644 --- a/tools/dtoc/test_dtoc.py +++ b/tools/dtoc/test_dtoc.py @@ -146,7 +146,8 @@ static struct dtd_sandbox_spl_test dtv_spl_test = { \t.bytearray\t\t= {0x6, 0x0, 0x0}, \t.byteval\t\t= 0x5, \t.intval\t\t\t= 0x1, -\t.longbytearray\t\t= {0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11}, +\t.longbytearray\t\t= {0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, +\t\t0x11}, \t.stringval\t\t= "message", \t.boolval\t\t= true, \t.intarray\t\t= {0x2, 0x3, 0x4, 0x0}, @@ -162,7 +163,8 @@ static struct dtd_sandbox_spl_test dtv_spl_test2 = { \t.bytearray\t\t= {0x1, 0x23, 0x34}, \t.byteval\t\t= 0x8, \t.intval\t\t\t= 0x3, -\t.longbytearray\t\t= {0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, +\t.longbytearray\t\t= {0x9, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, +\t\t0x0}, \t.stringval\t\t= "message2", \t.intarray\t\t= {0x5, 0x0, 0x0, 0x0}, \t.stringarray\t\t= {"another", "multi-word", "message"},