Patchwork [-v3,17/23] net/sunrpc: rename random32() to prandom_u32()

login
register
mail settings
Submitter Akinobu Mita
Date March 4, 2013, 12:58 p.m.
Message ID <1362401911-14074-18-git-send-email-akinobu.mita@gmail.com>
Download mbox | patch
Permalink /patch/224720/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Akinobu Mita - March 4, 2013, 12:58 p.m.
Use more preferable function name which implies using a pseudo-random
number generator.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: linux-nfs@vger.kernel.org
---

No change from v2

 net/sunrpc/auth_gss/gss_krb5_wrap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Trond Myklebust - March 4, 2013, 10:44 p.m.
On Mon, 2013-03-04 at 21:58 +0900, Akinobu Mita wrote:
> Use more preferable function name which implies using a pseudo-random
> number generator.
> 
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: "J. Bruce Fields" <bfields@fieldses.org>
> Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> Cc: linux-nfs@vger.kernel.org
> ---
> 
> No change from v2
> 
>  net/sunrpc/auth_gss/gss_krb5_wrap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
> index 88edec9..1da52d1 100644
> --- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
> +++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
> @@ -130,8 +130,8 @@ gss_krb5_make_confounder(char *p, u32 conflen)
>  
>  	/* initialize to random value */
>  	if (i == 0) {
> -		i = random32();
> -		i = (i << 32) | random32();
> +		i = prandom_u32();
> +		i = (i << 32) | prandom_u32();
>  	}
>  
>  	switch (conflen) {

Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Patch

diff --git a/net/sunrpc/auth_gss/gss_krb5_wrap.c b/net/sunrpc/auth_gss/gss_krb5_wrap.c
index 88edec9..1da52d1 100644
--- a/net/sunrpc/auth_gss/gss_krb5_wrap.c
+++ b/net/sunrpc/auth_gss/gss_krb5_wrap.c
@@ -130,8 +130,8 @@  gss_krb5_make_confounder(char *p, u32 conflen)
 
 	/* initialize to random value */
 	if (i == 0) {
-		i = random32();
-		i = (i << 32) | random32();
+		i = prandom_u32();
+		i = (i << 32) | prandom_u32();
 	}
 
 	switch (conflen) {