lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 26 Nov 2007 04:06:04 -0500 (EST)
From:	"Robert P. J. Day" <rpjday@...shcourse.ca>
To:	Joonwoo Park <joonwpark81@...il.com>
cc:	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/4] xfrm_hash: kmalloc + memset conversion to kzalloc

On Mon, 26 Nov 2007, Joonwoo Park wrote:

> xfrm_hash: kmalloc + memset conversion to kzalloc
>
> Signed-off-by: Joonwoo Park <joonwpark81@...il.com>
>
> Thanks.
> Joonwoo
>
> ---
> diff --git a/net/xfrm/xfrm_hash.c b/net/xfrm/xfrm_hash.c
> index 55ab579..37795bd 100644
> --- a/net/xfrm/xfrm_hash.c
> +++ b/net/xfrm/xfrm_hash.c
> @@ -17,16 +17,17 @@ struct hlist_head *xfrm_hash_alloc(unsigned int sz)
>  	struct hlist_head *n;
>
>  	if (sz <= PAGE_SIZE)
> -		n = kmalloc(sz, GFP_KERNEL);
> -	else if (hashdist)
> -		n = __vmalloc(sz, GFP_KERNEL, PAGE_KERNEL);
> -	else
> -		n = (struct hlist_head *)
> -			__get_free_pages(GFP_KERNEL | __GFP_NOWARN,
> -					 get_order(sz));
> -
> -	if (n)
> -		memset(n, 0, sz);
> +		n = kzalloc(sz, GFP_KERNEL);
> +	else {
> +		if (hashdist)

i believe the more common standard for the above is:

  else if (hashdist) {

to reduce the level of overall indentation, no?

rday

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists