aboutsummaryrefslogtreecommitdiffstats
path: root/arch
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
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')
-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
-rw-r--r--arch/sparc/mm/io-unit.c3
4 files changed, 5 insertions, 10 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;
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 2bb1309003dd..007062022967 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -41,9 +41,8 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus)
41 struct linux_prom_registers iommu_promregs[PROMREG_MAX]; 41 struct linux_prom_registers iommu_promregs[PROMREG_MAX];
42 struct resource r; 42 struct resource r;
43 43
44 iounit = kmalloc(sizeof(struct iounit_struct), GFP_ATOMIC); 44 iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
45 45
46 memset(iounit, 0, sizeof(*iounit));
47 iounit->limit[0] = IOUNIT_BMAP1_START; 46 iounit->limit[0] = IOUNIT_BMAP1_START;
48 iounit->limit[1] = IOUNIT_BMAP2_START; 47 iounit->limit[1] = IOUNIT_BMAP2_START;
49 iounit->limit[2] = IOUNIT_BMAPM_START; 48 iounit->limit[2] = IOUNIT_BMAPM_START;