From ca04494d76bf1152cd9ab1f67af5101c86e0824f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 28 Jul 2021 19:23:10 -0600 Subject: 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 Reported-by: Tom Rini --- test/dm/of_platdata.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'test') diff --git a/test/dm/of_platdata.c b/test/dm/of_platdata.c index 0f89c7a7da8..e3fa01afddf 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]); -- cgit v1.3.1