lkml.org 
[lkml]   [2012]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 15/29] lguest: rename random32() to prandom_u32()
    Date
    Use more preferable function name which implies using a pseudo-random
    number generator.

    Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
    Cc: Rusty Russell <rusty@rustcorp.com.au>
    Cc: lguest@lists.ozlabs.org
    ---
    drivers/lguest/page_tables.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    diff --git a/drivers/lguest/page_tables.c b/drivers/lguest/page_tables.c
    index 3b62be16..864baab 100644
    --- a/drivers/lguest/page_tables.c
    +++ b/drivers/lguest/page_tables.c
    @@ -686,7 +686,7 @@ static unsigned int new_pgdir(struct lg_cpu *cpu,
    * We pick one entry at random to throw out. Choosing the Least
    * Recently Used might be better, but this is easy.
    */
    - next = random32() % ARRAY_SIZE(cpu->lg->pgdirs);
    + next = prandom_u32() % ARRAY_SIZE(cpu->lg->pgdirs);
    /* If it's never been allocated at all before, try now. */
    if (!cpu->lg->pgdirs[next].pgdir) {
    cpu->lg->pgdirs[next].pgdir =
    --
    1.7.11.7


    \
     
     \ /
      Last update: 2012-12-24 03:41    [W:4.382 / U:0.060 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site