diff options
author | Yan Burman <burman.yan@gmail.com> | 2006-12-02 06:26:57 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 04:42:09 -0500 |
commit | f8485350c22b25f5b9804d89cb8fdf6626d0f5cb (patch) | |
tree | 969b17561afcf17362eebf16e59570bb66272d0b /arch/powerpc/kernel | |
parent | 04d76b937bdf60a8c9ac34e222e3ca977ab9ddc8 (diff) |
[POWERPC] Replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc.
Signed-off-by: Yan Burman <burman.yan@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas_flash.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/smp-tbsync.c | 3 |
4 files changed, 4 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 8e515797de6a..82bd2f10770f 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -214,11 +214,10 @@ static struct ibmebus_dev* __devinit ibmebus_register_device_node( | |||
214 | return NULL; | 214 | return NULL; |
215 | } | 215 | } |
216 | 216 | ||
217 | dev = kmalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); | 217 | dev = kzalloc(sizeof(struct ibmebus_dev), GFP_KERNEL); |
218 | if (!dev) { | 218 | if (!dev) { |
219 | return NULL; | 219 | return NULL; |
220 | } | 220 | } |
221 | memset(dev, 0, sizeof(struct ibmebus_dev)); | ||
222 | 221 | ||
223 | dev->ofdev.node = of_node_get(dn); | 222 | dev->ofdev.node = of_node_get(dn); |
224 | 223 | ||
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index afee470de924..6fa9a0a5c8db 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -330,7 +330,7 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
330 | struct pci_dev *dev; | 330 | struct pci_dev *dev; |
331 | const char *type; | 331 | const char *type; |
332 | 332 | ||
333 | dev = kmalloc(sizeof(struct pci_dev), GFP_KERNEL); | 333 | dev = kzalloc(sizeof(struct pci_dev), GFP_KERNEL); |
334 | if (!dev) | 334 | if (!dev) |
335 | return NULL; | 335 | return NULL; |
336 | type = get_property(node, "device_type", NULL); | 336 | type = get_property(node, "device_type", NULL); |
@@ -339,7 +339,6 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
339 | 339 | ||
340 | DBG(" create device, devfn: %x, type: %s\n", devfn, type); | 340 | DBG(" create device, devfn: %x, type: %s\n", devfn, type); |
341 | 341 | ||
342 | memset(dev, 0, sizeof(struct pci_dev)); | ||
343 | dev->bus = bus; | 342 | dev->bus = bus; |
344 | dev->sysdata = node; | 343 | dev->sysdata = node; |
345 | dev->dev.parent = bus->bridge; | 344 | dev->dev.parent = bus->bridge; |
diff --git a/arch/powerpc/kernel/rtas_flash.c b/arch/powerpc/kernel/rtas_flash.c index 6f6fc977cb39..b9561d300516 100644 --- a/arch/powerpc/kernel/rtas_flash.c +++ b/arch/powerpc/kernel/rtas_flash.c | |||
@@ -681,14 +681,12 @@ static int initialize_flash_pde_data(const char *rtas_call_name, | |||
681 | int *status; | 681 | int *status; |
682 | int token; | 682 | int token; |
683 | 683 | ||
684 | dp->data = kmalloc(buf_size, GFP_KERNEL); | 684 | dp->data = kzalloc(buf_size, GFP_KERNEL); |
685 | if (dp->data == NULL) { | 685 | if (dp->data == NULL) { |
686 | remove_flash_pde(dp); | 686 | remove_flash_pde(dp); |
687 | return -ENOMEM; | 687 | return -ENOMEM; |
688 | } | 688 | } |
689 | 689 | ||
690 | memset(dp->data, 0, buf_size); | ||
691 | |||
692 | /* | 690 | /* |
693 | * This code assumes that the status int is the first member of the | 691 | * This code assumes that the status int is the first member of the |
694 | * struct | 692 | * struct |
diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c index e1970f83f14a..bc892e69b4f7 100644 --- a/arch/powerpc/kernel/smp-tbsync.c +++ b/arch/powerpc/kernel/smp-tbsync.c | |||
@@ -116,8 +116,7 @@ void __devinit smp_generic_give_timebase(void) | |||
116 | printk("Synchronizing timebase\n"); | 116 | printk("Synchronizing timebase\n"); |
117 | 117 | ||
118 | /* if this fails then this kernel won't work anyway... */ | 118 | /* if this fails then this kernel won't work anyway... */ |
119 | tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL ); | 119 | tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL ); |
120 | memset( tbsync, 0, sizeof(*tbsync) ); | ||
121 | mb(); | 120 | mb(); |
122 | running = 1; | 121 | running = 1; |
123 | 122 | ||