[PATCH] dtoc: Correct dtoc output when testing

Simon Glass sjg at chromium.org
Thu Apr 29 18:03:38 CEST 2021

At present each invocation of run_steps() updates OUTPUT_FILES_COMMON,
since it does not make a copy of the dict. This is fine for a single
invocation, but for tests, run_steps() is invoked many times.

As a result it may include unwanted items from the previous run, if it
happens that a test runs twice on the same CPU. The problem has not been
noticied previously, as there are few enough tests and enough CPUs that
is is rare for the 'wrong' combination of tests to run together.

Fix this by making a copy of the dict, before updating it. Update the
tests to suit, taking account of the files that are no-longer generated.

With this fix, we no-longer generate files which are not needed for a
particular state of OF_PLATDATA_INST, so the check_instantiate() function
is not needed anymore. It has become dead code and so fails the
code-coverage test (dtoc -T). Remove it.

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

 tools/dtoc/dtb_platdata.py | 24 +-----------------
 tools/dtoc/test_dtoc.py    | 51 ++++++++++++++++----------------------
 2 files changed, 22 insertions(+), 53 deletions(-)

Applied to u-boot-dm, thanks!

More information about the U-Boot mailing list