summaryrefslogtreecommitdiff
path: root/test/dm
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-07-28 19:23:10 -0600
committerSimon Glass <sjg@chromium.org>2021-08-01 09:05:24 -0600
commitca04494d76bf1152cd9ab1f67af5101c86e0824f (patch)
treefe4d76d9f16f939914bca1af05da83b05d055cdd /test/dm
parentdf82de805172687e88dd7d72b68a9223b0a4c269 (diff)
downloadu-boot-ca04494d76bf1152cd9ab1f67af5101c86e0824f.tar.gz
u-boot-ca04494d76bf1152cd9ab1f67af5101c86e0824f.tar.bz2
u-boot-ca04494d76bf1152cd9ab1f67af5101c86e0824f.zip
dtoc: Fix widening an int array to an int
An int array can hold a single int so we should not need to do anything in the widening operation. However due to a quirk in the code, an int[3] widened with an int produced an int[4]. Fix this and add a test. Fix a comment typo while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'test/dm')
-rw-r--r--test/dm/of_platdata.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c
index 0f89c7a7da..e3fa01afdd 100644
--- a/test/dm/of_platdata.c
+++ b/test/dm/of_platdata.c
@@ -35,11 +35,10 @@ static int dm_test_of_plat_props(struct unit_test_state *uts)
plat = dev_get_plat(dev);
ut_assert(plat->boolval);
ut_asserteq(1, plat->intval);
- ut_asserteq(4, ARRAY_SIZE(plat->intarray));
+ ut_asserteq(3, ARRAY_SIZE(plat->intarray));
ut_asserteq(2, plat->intarray[0]);
ut_asserteq(3, plat->intarray[1]);
ut_asserteq(4, plat->intarray[2]);
- ut_asserteq(0, plat->intarray[3]);
ut_asserteq(5, plat->byteval);
ut_asserteq(3, ARRAY_SIZE(plat->bytearray));
ut_asserteq(6, plat->bytearray[0]);
@@ -61,7 +60,6 @@ static int dm_test_of_plat_props(struct unit_test_state *uts)
ut_asserteq(5, plat->intarray[0]);
ut_asserteq(0, plat->intarray[1]);
ut_asserteq(0, plat->intarray[2]);
- ut_asserteq(0, plat->intarray[3]);
ut_asserteq(8, plat->byteval);
ut_asserteq(3, ARRAY_SIZE(plat->bytearray));
ut_asserteq(1, plat->bytearray[0]);