[PATCH 05/20] dtoc: Fix widening of int to bytes

Simon Glass sjg at chromium.org
Tue Oct 27 02:01:13 CET 2020


At present an integer is converted to bytes incorrectly. The whole 32-bit
integer is inserted as the first element of the byte array, and the other
three bytes are skipped. This was not noticed because the unit test did
not check it, and the functional test was checking for wrong values.

Update the code to handle this as a special case. Add one more test to
cover all code paths.

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

 test/py/tests/test_ofplatdata.py |  2 +-
 tools/dtoc/dtoc_test_simple.dts  |  1 +
 tools/dtoc/fdt.py                |  9 +++++++++
 tools/dtoc/test_dtoc.py          |  4 +++-
 tools/dtoc/test_fdt.py           | 10 ++++++++++
 5 files changed, 24 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!


More information about the U-Boot mailing list