UBIFS: rename random32() to prandom_u32()
Use more preferable function name which implies using a pseudo-random number generator. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
This commit is contained in:

committed by
Artem Bityutskiy

parent
9931faca02
commit
3d251a5b9e
@@ -2007,28 +2007,28 @@ static int dbg_populate_lsave(struct ubifs_info *c)
|
||||
|
||||
if (!dbg_is_chk_gen(c))
|
||||
return 0;
|
||||
if (random32() & 3)
|
||||
if (prandom_u32() & 3)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < c->lsave_cnt; i++)
|
||||
c->lsave[i] = c->main_first;
|
||||
|
||||
list_for_each_entry(lprops, &c->empty_list, list)
|
||||
c->lsave[random32() % c->lsave_cnt] = lprops->lnum;
|
||||
c->lsave[prandom_u32() % c->lsave_cnt] = lprops->lnum;
|
||||
list_for_each_entry(lprops, &c->freeable_list, list)
|
||||
c->lsave[random32() % c->lsave_cnt] = lprops->lnum;
|
||||
c->lsave[prandom_u32() % c->lsave_cnt] = lprops->lnum;
|
||||
list_for_each_entry(lprops, &c->frdi_idx_list, list)
|
||||
c->lsave[random32() % c->lsave_cnt] = lprops->lnum;
|
||||
c->lsave[prandom_u32() % c->lsave_cnt] = lprops->lnum;
|
||||
|
||||
heap = &c->lpt_heap[LPROPS_DIRTY_IDX - 1];
|
||||
for (i = 0; i < heap->cnt; i++)
|
||||
c->lsave[random32() % c->lsave_cnt] = heap->arr[i]->lnum;
|
||||
c->lsave[prandom_u32() % c->lsave_cnt] = heap->arr[i]->lnum;
|
||||
heap = &c->lpt_heap[LPROPS_DIRTY - 1];
|
||||
for (i = 0; i < heap->cnt; i++)
|
||||
c->lsave[random32() % c->lsave_cnt] = heap->arr[i]->lnum;
|
||||
c->lsave[prandom_u32() % c->lsave_cnt] = heap->arr[i]->lnum;
|
||||
heap = &c->lpt_heap[LPROPS_FREE - 1];
|
||||
for (i = 0; i < heap->cnt; i++)
|
||||
c->lsave[random32() % c->lsave_cnt] = heap->arr[i]->lnum;
|
||||
c->lsave[prandom_u32() % c->lsave_cnt] = heap->arr[i]->lnum;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user