From: Simon Glass Date: Fri, 14 May 2021 01:39:23 +0000 (-0600) Subject: test: Avoid random numbers in dm_test_devm_regmap() X-Git-Url: http://git.dujemihanovic.xyz/%22/img/sics.gif/%22/static/git-favicon.png?a=commitdiff_plain;h=2177f924bf585d083fdbb3c1ff1479794ee8ccac;p=u-boot.git 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 Reported-by: Coverity (CID: 312949) --- 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++) {