From patchwork Tue Sep 27 15:03:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 675682 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 3sk41x2xmkz9sD6 for ; Wed, 28 Sep 2016 01:07:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E530BB3867; Tue, 27 Sep 2016 17:06:49 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tkmaNx65_2Yv; Tue, 27 Sep 2016 17:06:49 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A555A7680; Tue, 27 Sep 2016 17:06:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4632AA7680 for ; Tue, 27 Sep 2016 17:06:46 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2l4snm2F3nBf for ; Tue, 27 Sep 2016 17:06:46 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailapp01.imgtec.com (mailapp02.imgtec.com [217.156.133.132]) by theia.denx.de (Postfix) with ESMTP id 0AE60A7668 for ; Tue, 27 Sep 2016 17:06:43 +0200 (CEST) Received: from HHMAIL03.hh.imgtec.org (unknown [10.44.0.21]) by Forcepoint Email with ESMTPS id 25F3DEB1CCAFE; Tue, 27 Sep 2016 16:06:39 +0100 (IST) Received: from HHMAIL01.hh.imgtec.org (10.100.10.19) by HHMAIL03.hh.imgtec.org (10.44.0.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 27 Sep 2016 16:06:42 +0100 Received: from localhost (10.100.200.122) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Tue, 27 Sep 2016 16:06:41 +0100 From: Paul Burton To: Date: Tue, 27 Sep 2016 16:03:58 +0100 Message-ID: <20160927150358.6248-11-paul.burton@imgtec.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20160927150358.6248-1-paul.burton@imgtec.com> References: <20160927150358.6248-1-paul.burton@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [10.100.200.122] Subject: [U-Boot] [PATCH v2 10/10] dtoc: Make integer division python 3.x safe X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" If we use the '/' operator then python 3.x will produce a float, and refuse to multiply the string sequence in Conv_name_to_c by it with: TypeError: can't multiply sequence by non-int of type 'float' Use the '//' operator instead to enforce that we want integer rather than floating point division. Signed-off-by: Paul Burton Acked-by: Simon Glass --- Changes in v2: None tools/dtoc/dtoc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py index 12aa990..11050b6 100755 --- a/tools/dtoc/dtoc.py +++ b/tools/dtoc/dtoc.py @@ -60,7 +60,7 @@ def Conv_name_to_c(name): def TabTo(num_tabs, str): if len(str) >= num_tabs * 8: return str + ' ' - return str + '\t' * (num_tabs - len(str) / 8) + return str + '\t' * (num_tabs - len(str) // 8) class DtbPlatdata: """Provide a means to convert device tree binary data to platform data