public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.19] e100: replace kmalloc with kcalloc
@ 2006-12-12 16:55 Yan Burman
  2006-12-12 18:34 ` Auke Kok
  0 siblings, 1 reply; 2+ messages in thread
From: Yan Burman @ 2006-12-12 16:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: trivial, john.ronciak

Replace kmalloc+memset with kcalloc

Signed-off-by: Yan Burman <burman.yan@gmail.com>

diff -rubp linux-2.6.19-rc5_orig/drivers/net/e100.c linux-2.6.19-rc5_kzalloc/drivers/net/e100.c
--- linux-2.6.19-rc5_orig/drivers/net/e100.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/drivers/net/e100.c	2006-11-11 22:44:04.000000000 +0200
@@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic
 	nic->rx_to_use = nic->rx_to_clean = NULL;
 	nic->ru_running = RU_UNINITIALIZED;
 
-	if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC)))
+	if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
 		return -ENOMEM;
-	memset(nic->rxs, 0, sizeof(struct rx) * count);
 
 	for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
 		rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.19] e100: replace kmalloc with kcalloc
  2006-12-12 16:55 [PATCH 2.6.19] e100: replace kmalloc with kcalloc Yan Burman
@ 2006-12-12 18:34 ` Auke Kok
  0 siblings, 0 replies; 2+ messages in thread
From: Auke Kok @ 2006-12-12 18:34 UTC (permalink / raw)
  To: Yan Burman; +Cc: linux-kernel, trivial, john.ronciak, NetDev, Jeff Garzik

Yan Burman wrote:
> Replace kmalloc+memset with kcalloc

ACK, fine with me.

> Signed-off-by: Yan Burman <burman.yan@gmail.com>
> 
> diff -rubp linux-2.6.19-rc5_orig/drivers/net/e100.c linux-2.6.19-rc5_kzalloc/drivers/net/e100.c
> --- linux-2.6.19-rc5_orig/drivers/net/e100.c	2006-11-09 12:16:21.000000000 +0200
> +++ linux-2.6.19-rc5_kzalloc/drivers/net/e100.c	2006-11-11 22:44:04.000000000 +0200
> @@ -1930,9 +1930,8 @@ static int e100_rx_alloc_list(struct nic
>  	nic->rx_to_use = nic->rx_to_clean = NULL;
>  	nic->ru_running = RU_UNINITIALIZED;
>  
> -	if(!(nic->rxs = kmalloc(sizeof(struct rx) * count, GFP_ATOMIC)))
> +	if(!(nic->rxs = kcalloc(count, sizeof(struct rx), GFP_ATOMIC)))
>  		return -ENOMEM;
> -	memset(nic->rxs, 0, sizeof(struct rx) * count);
>  
>  	for(rx = nic->rxs, i = 0; i < count; rx++, i++) {
>  		rx->next = (i + 1 < count) ? rx + 1 : nic->rxs;
> 
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-12 18:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-12 16:55 [PATCH 2.6.19] e100: replace kmalloc with kcalloc Yan Burman
2006-12-12 18:34 ` Auke Kok

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox