diff mbox series

[U-Boot,41/53] binman: Add a prefix before CBFS hex offsets

Message ID 20190720182416.183626-42-sjg@chromium.org
State Accepted
Commit 17a7421ff417f21d0e3e151c992d7188ded3c0d3
Delegated to: Simon Glass
Headers show
Series binman: Support replacing entries in an existing image | expand

Commit Message

Simon Glass July 20, 2019, 6:24 p.m. UTC
Add a 0x prefix to these errors to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/cbfs_util.py      | 4 ++--
 tools/binman/cbfs_util_test.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Simon Glass July 29, 2019, 9:22 p.m. UTC | #1
Add a 0x prefix to these errors to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/binman/cbfs_util.py      | 4 ++--
 tools/binman/cbfs_util_test.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/tools/binman/cbfs_util.py b/tools/binman/cbfs_util.py
index 45e16da0aaa..6d9a876ee85 100644
--- a/tools/binman/cbfs_util.py
+++ b/tools/binman/cbfs_util.py
@@ -715,7 +715,7 @@  class CbfsReader(object):
         file_pos = fd.tell()
         data = fd.read(FILE_HEADER_LEN)
         if len(data) < FILE_HEADER_LEN:
-            print('File header at %x ran out of data' % file_pos)
+            print('File header at %#x ran out of data' % file_pos)
             return False
         magic, size, ftype, attr, offset = struct.unpack(FILE_HEADER_FORMAT,
                                                          data)
@@ -724,7 +724,7 @@  class CbfsReader(object):
         pos = fd.tell()
         name = self._read_string(fd)
         if name is None:
-            print('String at %x ran out of data' % pos)
+            print('String at %#x ran out of data' % pos)
             return False
 
         if DEBUG:
diff --git a/tools/binman/cbfs_util_test.py b/tools/binman/cbfs_util_test.py
index 0fe4aa494ec..772c794eceb 100755
--- a/tools/binman/cbfs_util_test.py
+++ b/tools/binman/cbfs_util_test.py
@@ -372,7 +372,7 @@  class TestCbfs(unittest.TestCase):
             with io.BytesIO(newdata) as fd:
                 fd.seek(pos)
                 self.assertEqual(False, cbr._read_next_file(fd))
-        self.assertIn('File header at 0 ran out of data', stdout.getvalue())
+        self.assertIn('File header at 0x0 ran out of data', stdout.getvalue())
 
     def test_cbfs_bad_file_string(self):
         """Check handling of an incomplete filename string"""
@@ -394,7 +394,7 @@  class TestCbfs(unittest.TestCase):
             with io.BytesIO(newdata) as fd:
                 fd.seek(pos)
                 self.assertEqual(False, cbr._read_next_file(fd))
-        self.assertIn('String at %x ran out of data' %
+        self.assertIn('String at %#x ran out of data' %
                       cbfs_util.FILE_HEADER_LEN, stdout.getvalue())
 
     def test_cbfs_debug(self):