Skip to content
Snippets Groups Projects
Commit 34c38896 authored by Paul Burton's avatar Paul Burton Committed by sjg
Browse files

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: default avatarPaul Burton <paul.burton@imgtec.com>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent c4c5f9ee
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment