summaryrefslogtreecommitdiff
path: root/tools/dtoc
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2016-09-27 16:03:58 +0100
committersjg <sjg@chromium.org>2016-10-09 09:30:32 -0600
commit34c38896357db4aae266b14346927da2cd920de6 (patch)
tree79f12550019f5aab4df1d5f634dee6153a3b847f /tools/dtoc
parentc4c5f9eefbda7231d0e9703905524faebe71e795 (diff)
downloadu-boot-34c38896357db4aae266b14346927da2cd920de6.tar.gz
dtoc: Make integer division python 3.x safe
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 <paul.burton@imgtec.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/dtoc')
-rwxr-xr-xtools/dtoc/dtoc.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/dtoc/dtoc.py b/tools/dtoc/dtoc.py
index 12aa9905ec..11050b66f7 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