summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-05-13 19:39:23 -0600
committerTom Rini <trini@konsulko.com>2021-05-24 14:21:30 -0400
commit2177f924bf585d083fdbb3c1ff1479794ee8ccac (patch)
tree654abcb95b24b48669b66e40ce8d6b35fc55f4e6 /test
parenta2cfad8ecc28923db6f826c01359c768980085e7 (diff)
downloadu-boot-2177f924bf585d083fdbb3c1ff1479794ee8ccac.tar.gz
u-boot-2177f924bf585d083fdbb3c1ff1479794ee8ccac.tar.bz2
u-boot-2177f924bf585d083fdbb3c1ff1479794ee8ccac.zip
test: Avoid random numbers in dm_test_devm_regmap()
There is no good reason to use a sequence from rand() here. We may as well invent our own sequence. This should molify Coverity which does not use rand() being used. Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Coverity (CID: 312949)
Diffstat (limited to 'test')
-rw-r--r--test/dm/regmap.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/dm/regmap.c b/test/dm/regmap.c
index 372a73ca0c..04bb1645d1 100644
--- a/test/dm/regmap.c
+++ b/test/dm/regmap.c
@@ -306,9 +306,8 @@ static int dm_test_devm_regmap(struct unit_test_state *uts)
&dev));
priv = dev_get_priv(dev);
- srand(get_ticks() + rand());
for (i = 0; i < REGMAP_TEST_BUF_SZ; i++) {
- pattern[i] = rand();
+ pattern[i] = i * 0x87654321;
ut_assertok(regmap_write(priv->cfg_regmap, i, pattern[i]));
}
for (i = 0; i < REGMAP_TEST_BUF_SZ; i++) {