aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorYan Burman <burman.yan@gmail.com>2006-11-30 20:07:04 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-10 05:40:00 -0500
commitc80892d150a872b18cedfbf789211bfbebfc67ce (patch)
tree8866c07d324e2a147d637056be296f195335eec5 /arch/sparc/kernel
parenta2c1e064c45f5126625121f58afa423e13c55efc (diff)
[SPARC]: Replace kmalloc+memset with kzalloc
Replace kmalloc+memset with kzalloc Signed-off-by: Yan Burman <burman.yan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/ioport.c6
-rw-r--r--arch/sparc/kernel/of_device.c3
-rw-r--r--arch/sparc/kernel/sun4d_irq.c3
3 files changed, 4 insertions, 8 deletions
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c
index 54d51b404603..cbbc98846b00 100644
--- a/arch/sparc/kernel/ioport.c
+++ b/arch/sparc/kernel/ioport.c
@@ -317,9 +317,8 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp)
317 if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0) 317 if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0)
318 goto err_nopages; 318 goto err_nopages;
319 319
320 if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) 320 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL)
321 goto err_nomem; 321 goto err_nomem;
322 memset((char*)res, 0, sizeof(struct resource));
323 322
324 if (allocate_resource(&_sparc_dvma, res, len_total, 323 if (allocate_resource(&_sparc_dvma, res, len_total,
325 _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) { 324 _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) {
@@ -589,12 +588,11 @@ void *pci_alloc_consistent(struct pci_dev *pdev, size_t len, dma_addr_t *pba)
589 return NULL; 588 return NULL;
590 } 589 }
591 590
592 if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { 591 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) {
593 free_pages(va, order); 592 free_pages(va, order);
594 printk("pci_alloc_consistent: no core\n"); 593 printk("pci_alloc_consistent: no core\n");
595 return NULL; 594 return NULL;
596 } 595 }
597 memset((char*)res, 0, sizeof(struct resource));
598 596
599 if (allocate_resource(&_sparc_dvma, res, len_total, 597 if (allocate_resource(&_sparc_dvma, res, len_total,
600 _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) { 598 _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) {
diff --git a/arch/sparc/kernel/of_device.c b/arch/sparc/kernel/of_device.c
index 46200c43ffb1..dab6169e31ca 100644
--- a/arch/sparc/kernel/of_device.c
+++ b/arch/sparc/kernel/of_device.c
@@ -793,10 +793,9 @@ struct of_device* of_platform_device_create(struct device_node *np,
793{ 793{
794 struct of_device *dev; 794 struct of_device *dev;
795 795
796 dev = kmalloc(sizeof(*dev), GFP_KERNEL); 796 dev = kzalloc(sizeof(*dev), GFP_KERNEL);
797 if (!dev) 797 if (!dev)
798 return NULL; 798 return NULL;
799 memset(dev, 0, sizeof(*dev));
800 799
801 dev->dev.parent = parent; 800 dev->dev.parent = parent;
802 dev->dev.bus = bus; 801 dev->dev.bus = bus;
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c
index d4f9da8170c5..b8bd53ab29c5 100644
--- a/arch/sparc/kernel/sun4d_irq.c
+++ b/arch/sparc/kernel/sun4d_irq.c
@@ -545,8 +545,7 @@ void __init sun4d_init_sbi_irq(void)
545 nsbi = 0; 545 nsbi = 0;
546 for_each_sbus(sbus) 546 for_each_sbus(sbus)
547 nsbi++; 547 nsbi++;
548 sbus_actions = (struct sbus_action *)kmalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC); 548 sbus_actions = kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC);
549 memset (sbus_actions, 0, (nsbi * 8 * 4 * sizeof(struct sbus_action)));
550 for_each_sbus(sbus) { 549 for_each_sbus(sbus) {
551#ifdef CONFIG_SMP 550#ifdef CONFIG_SMP
552 extern unsigned char boot_cpu_id; 551 extern unsigned char boot_cpu_id;