diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-03-20 14:46:41 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-21 17:06:17 -0500 |
commit | d2a02b93cf78205dd23226efb66481569900976e (patch) | |
tree | 94760abdafe5cb72a41d3edd405a26d0c8e2e0d3 /arch/arm/kernel | |
parent | 18ec5c731271939acb414614e964c15c8ef52156 (diff) |
[ARM] Convert kmalloc+memset to kzalloc
Convert all uses of kmalloc followed by memset to use kzalloc instead.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/apm.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/bios32.c | 4 | ||||
-rw-r--r-- | arch/arm/kernel/ecard.c | 4 |
3 files changed, 3 insertions, 9 deletions
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c index 766b6c05c6db..2bed290fec76 100644 --- a/arch/arm/kernel/apm.c +++ b/arch/arm/kernel/apm.c | |||
@@ -357,10 +357,8 @@ static int apm_open(struct inode * inode, struct file * filp) | |||
357 | { | 357 | { |
358 | struct apm_user *as; | 358 | struct apm_user *as; |
359 | 359 | ||
360 | as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL); | 360 | as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL); |
361 | if (as) { | 361 | if (as) { |
362 | memset(as, 0, sizeof(*as)); | ||
363 | |||
364 | /* | 362 | /* |
365 | * XXX - this is a tiny bit broken, when we consider BSD | 363 | * XXX - this is a tiny bit broken, when we consider BSD |
366 | * process accounting. If the device is opened by root, we | 364 | * process accounting. If the device is opened by root, we |
diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index c4923fac8dff..de606dfa8db9 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c | |||
@@ -540,12 +540,10 @@ static void __init pcibios_init_hw(struct hw_pci *hw) | |||
540 | int nr, busnr; | 540 | int nr, busnr; |
541 | 541 | ||
542 | for (nr = busnr = 0; nr < hw->nr_controllers; nr++) { | 542 | for (nr = busnr = 0; nr < hw->nr_controllers; nr++) { |
543 | sys = kmalloc(sizeof(struct pci_sys_data), GFP_KERNEL); | 543 | sys = kzalloc(sizeof(struct pci_sys_data), GFP_KERNEL); |
544 | if (!sys) | 544 | if (!sys) |
545 | panic("PCI: unable to allocate sys data!"); | 545 | panic("PCI: unable to allocate sys data!"); |
546 | 546 | ||
547 | memset(sys, 0, sizeof(struct pci_sys_data)); | ||
548 | |||
549 | sys->hw = hw; | 547 | sys->hw = hw; |
550 | sys->busnr = busnr; | 548 | sys->busnr = busnr; |
551 | sys->swizzle = hw->swizzle; | 549 | sys->swizzle = hw->swizzle; |
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index 74ea29c3205e..00aa225e8d95 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c | |||
@@ -807,14 +807,12 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot) | |||
807 | unsigned long base; | 807 | unsigned long base; |
808 | int i; | 808 | int i; |
809 | 809 | ||
810 | ec = kmalloc(sizeof(ecard_t), GFP_KERNEL); | 810 | ec = kzalloc(sizeof(ecard_t), GFP_KERNEL); |
811 | if (!ec) { | 811 | if (!ec) { |
812 | ec = ERR_PTR(-ENOMEM); | 812 | ec = ERR_PTR(-ENOMEM); |
813 | goto nomem; | 813 | goto nomem; |
814 | } | 814 | } |
815 | 815 | ||
816 | memset(ec, 0, sizeof(ecard_t)); | ||
817 | |||
818 | ec->slot_no = slot; | 816 | ec->slot_no = slot; |
819 | ec->type = type; | 817 | ec->type = type; |
820 | ec->irq = NO_IRQ; | 818 | ec->irq = NO_IRQ; |