public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.19] m68k: replace kmalloc+memset with kzalloc
@ 2006-12-02 11:29 Yan Burman
  2006-12-03 10:40 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Yan Burman @ 2006-12-02 11:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: geert, zippel, trivial

Replace kmalloc+memset with kzalloc 

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

diff -rubp linux-2.6.19-rc5_orig/arch/m68k/amiga/chipram.c linux-2.6.19-rc5_kzalloc/arch/m68k/amiga/chipram.c
--- linux-2.6.19-rc5_orig/arch/m68k/amiga/chipram.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/m68k/amiga/chipram.c	2006-11-11 22:44:04.000000000 +0200
@@ -52,10 +52,9 @@ void *amiga_chip_alloc(unsigned long siz
 #ifdef DEBUG
     printk("amiga_chip_alloc: allocate %ld bytes\n", size);
 #endif
-    res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+    res = kzalloc(sizeof(struct resource), GFP_KERNEL);
     if (!res)
 	return NULL;
-    memset(res, 0, sizeof(struct resource));
     res->name = name;
 
     if (allocate_resource(&chipram_res, res, size, 0, UINT_MAX, PAGE_SIZE, NULL, NULL) < 0) {

diff -rubp linux-2.6.19-rc5_orig/arch/m68k/atari/hades-pci.c linux-2.6.19-rc5_kzalloc/arch/m68k/atari/hades-pci.c
--- linux-2.6.19-rc5_orig/arch/m68k/atari/hades-pci.c	2006-11-09 12:16:21.000000000 +0200
+++ linux-2.6.19-rc5_kzalloc/arch/m68k/atari/hades-pci.c	2006-11-11 22:44:04.000000000 +0200
@@ -375,10 +375,9 @@ struct pci_bus_info * __init init_hades_
 	 * Allocate memory for bus info structure.
 	 */
 
-	bus = kmalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
+	bus = kzalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
 	if (!bus)
 		return NULL;
-	memset(bus, 0, sizeof(struct pci_bus_info));
 
 	/*
 	 * Claim resources. The m68k has no separate I/O space, both




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

* Re: [PATCH 2.6.19] m68k: replace kmalloc+memset with kzalloc
  2006-12-02 11:29 [PATCH 2.6.19] m68k: replace kmalloc+memset with kzalloc Yan Burman
@ 2006-12-03 10:40 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2006-12-03 10:40 UTC (permalink / raw)
  To: Yan Burman
  Cc: Linux Kernel Development, Roman Zippel, Geert Uytterhoeven,
	trivial

On Sat, 2 Dec 2006, Yan Burman wrote:
> Replace kmalloc+memset with kzalloc 
> 
> Signed-off-by: Yan Burman <burman.yan@gmail.com>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

> diff -rubp linux-2.6.19-rc5_orig/arch/m68k/amiga/chipram.c linux-2.6.19-rc5_kzalloc/arch/m68k/amiga/chipram.c
> --- linux-2.6.19-rc5_orig/arch/m68k/amiga/chipram.c	2006-11-09 12:16:21.000000000 +0200
> +++ linux-2.6.19-rc5_kzalloc/arch/m68k/amiga/chipram.c	2006-11-11 22:44:04.000000000 +0200
> @@ -52,10 +52,9 @@ void *amiga_chip_alloc(unsigned long siz
>  #ifdef DEBUG
>      printk("amiga_chip_alloc: allocate %ld bytes\n", size);
>  #endif
> -    res = kmalloc(sizeof(struct resource), GFP_KERNEL);
> +    res = kzalloc(sizeof(struct resource), GFP_KERNEL);
>      if (!res)
>  	return NULL;
> -    memset(res, 0, sizeof(struct resource));
>      res->name = name;
>  
>      if (allocate_resource(&chipram_res, res, size, 0, UINT_MAX, PAGE_SIZE, NULL, NULL) < 0) {
> 
> diff -rubp linux-2.6.19-rc5_orig/arch/m68k/atari/hades-pci.c linux-2.6.19-rc5_kzalloc/arch/m68k/atari/hades-pci.c
> --- linux-2.6.19-rc5_orig/arch/m68k/atari/hades-pci.c	2006-11-09 12:16:21.000000000 +0200
> +++ linux-2.6.19-rc5_kzalloc/arch/m68k/atari/hades-pci.c	2006-11-11 22:44:04.000000000 +0200
> @@ -375,10 +375,9 @@ struct pci_bus_info * __init init_hades_
>  	 * Allocate memory for bus info structure.
>  	 */
>  
> -	bus = kmalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
> +	bus = kzalloc(sizeof(struct pci_bus_info), GFP_KERNEL);
>  	if (!bus)
>  		return NULL;
> -	memset(bus, 0, sizeof(struct pci_bus_info));
>  
>  	/*
>  	 * Claim resources. The m68k has no separate I/O space, both
> 
> 
> 

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

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

end of thread, other threads:[~2006-12-03 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-02 11:29 [PATCH 2.6.19] m68k: replace kmalloc+memset with kzalloc Yan Burman
2006-12-03 10:40 ` Geert Uytterhoeven

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