mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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)
This commit is contained in:
parent
a2cfad8ecc
commit
2177f924bf
1 changed files with 1 additions and 2 deletions
|
@ -306,9 +306,8 @@ static int dm_test_devm_regmap(struct unit_test_state *uts)
|
||||||
&dev));
|
&dev));
|
||||||
priv = dev_get_priv(dev);
|
priv = dev_get_priv(dev);
|
||||||
|
|
||||||
srand(get_ticks() + rand());
|
|
||||||
for (i = 0; i < REGMAP_TEST_BUF_SZ; i++) {
|
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]));
|
ut_assertok(regmap_write(priv->cfg_regmap, i, pattern[i]));
|
||||||
}
|
}
|
||||||
for (i = 0; i < REGMAP_TEST_BUF_SZ; i++) {
|
for (i = 0; i < REGMAP_TEST_BUF_SZ; i++) {
|
||||||
|
|
Loading…
Reference in a new issue