]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drbd: rename random32() to prandom_u32()
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 17 Apr 2013 23:49:17 +0000 (09:49 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 22 Apr 2013 08:08:32 +0000 (18:08 +1000)
Use preferable function name which implies using a pseudo-random
number generator.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/drbd/drbd_receiver.c

index 0f449bbf0edf17082455f1806a4b86eabb96fbeb..4222affff488bc15c116187e2eb382af5f2d0508 100644 (file)
@@ -757,7 +757,8 @@ static struct socket *drbd_wait_for_connect(struct drbd_tconn *tconn, struct acc
        rcu_read_unlock();
 
        timeo = connect_int * HZ;
-       timeo += (random32() & 1) ? timeo / 7 : -timeo / 7; /* 28.5% random jitter */
+       /* 28.5% random jitter */
+       timeo += (prandom_u32() & 1) ? timeo / 7 : -timeo / 7;
 
        err = wait_for_completion_interruptible_timeout(&ad->door_bell, timeo);
        if (err <= 0)
@@ -954,7 +955,7 @@ retry:
                                conn_warn(tconn, "Error receiving initial packet\n");
                                sock_release(s);
 randomize:
-                               if (random32() & 1)
+                               if (prandom_u32() & 1)
                                        goto retry;
                        }
                }