test: fix test/dm/regmap.c
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 11 Apr 2021 09:21:56 +0000 (11:21 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 20 Apr 2021 11:31:12 +0000 (07:31 -0400)
commit1b8897c63e4c4eedd55f69f9728cd49f2a1cddba
tree2a65b1ed57e18f7bd06e626bc20ec66fac09a2b6
parentfd90aca329a37eade4187ca886a8dea5c60aaba0
test: fix test/dm/regmap.c

regmap_read() only fills the first two bytes of val. The last two bytes are
random data from the stack. This means the test will fail randomly.

For low endian systems we could simply initialize val to 0 and get correct
results. But tests should not depend on endianness. So let's use a pointer
conversion instead.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
test/dm/regmap.c