From ee8aaf56d589e71cfa2fb82959be087f83c7095b Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Thu, 30 Nov 2006 17:07:04 -0800 Subject: [PATCH] --- yaml --- r: 44159 b: refs/heads/master c: c80892d150a872b18cedfbf789211bfbebfc67ce h: refs/heads/master i: 44157: f6de21262e0c56c9291c18d11968ad2e65f5b400 44155: 205bbf53bdf80aa734bf97296116512e1777eaa2 44151: d6b5a1444d44e81020bfd46b33382e61ba341805 44143: 7f2b888ca03fe2f08fffd70943361b1a7ac60649 44127: e63348ec79fad4d9234bfb3f4de2607ba91612a2 44095: 4ba9d2234620abdb78879083e68182a19bb7280e 44031: 1bdd551d76c2112ee6b8aadf47e6a2e24a2981fb v: v3 --- [refs] | 2 +- trunk/arch/sparc/kernel/ioport.c | 6 ++---- trunk/arch/sparc/kernel/of_device.c | 3 +-- trunk/arch/sparc/kernel/sun4d_irq.c | 3 +-- trunk/arch/sparc/mm/io-unit.c | 3 +-- 5 files changed, 6 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 0746dd0414d3..3165c69f4803 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a2c1e064c45f5126625121f58afa423e13c55efc +refs/heads/master: c80892d150a872b18cedfbf789211bfbebfc67ce diff --git a/trunk/arch/sparc/kernel/ioport.c b/trunk/arch/sparc/kernel/ioport.c index 54d51b404603..cbbc98846b00 100644 --- a/trunk/arch/sparc/kernel/ioport.c +++ b/trunk/arch/sparc/kernel/ioport.c @@ -317,9 +317,8 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp) if ((va = __get_free_pages(GFP_KERNEL|__GFP_COMP, order)) == 0) goto err_nopages; - if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) + if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) goto err_nomem; - memset((char*)res, 0, sizeof(struct resource)); if (allocate_resource(&_sparc_dvma, res, len_total, _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) return NULL; } - if ((res = kmalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { + if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { free_pages(va, order); printk("pci_alloc_consistent: no core\n"); return NULL; } - memset((char*)res, 0, sizeof(struct resource)); if (allocate_resource(&_sparc_dvma, res, len_total, _sparc_dvma.start, _sparc_dvma.end, PAGE_SIZE, NULL, NULL) != 0) { diff --git a/trunk/arch/sparc/kernel/of_device.c b/trunk/arch/sparc/kernel/of_device.c index 46200c43ffb1..dab6169e31ca 100644 --- a/trunk/arch/sparc/kernel/of_device.c +++ b/trunk/arch/sparc/kernel/of_device.c @@ -793,10 +793,9 @@ struct of_device* of_platform_device_create(struct device_node *np, { struct of_device *dev; - dev = kmalloc(sizeof(*dev), GFP_KERNEL); + dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return NULL; - memset(dev, 0, sizeof(*dev)); dev->dev.parent = parent; dev->dev.bus = bus; diff --git a/trunk/arch/sparc/kernel/sun4d_irq.c b/trunk/arch/sparc/kernel/sun4d_irq.c index d4f9da8170c5..b8bd53ab29c5 100644 --- a/trunk/arch/sparc/kernel/sun4d_irq.c +++ b/trunk/arch/sparc/kernel/sun4d_irq.c @@ -545,8 +545,7 @@ void __init sun4d_init_sbi_irq(void) nsbi = 0; for_each_sbus(sbus) nsbi++; - sbus_actions = (struct sbus_action *)kmalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC); - memset (sbus_actions, 0, (nsbi * 8 * 4 * sizeof(struct sbus_action))); + sbus_actions = kzalloc (nsbi * 8 * 4 * sizeof(struct sbus_action), GFP_ATOMIC); for_each_sbus(sbus) { #ifdef CONFIG_SMP extern unsigned char boot_cpu_id; diff --git a/trunk/arch/sparc/mm/io-unit.c b/trunk/arch/sparc/mm/io-unit.c index 2bb1309003dd..007062022967 100644 --- a/trunk/arch/sparc/mm/io-unit.c +++ b/trunk/arch/sparc/mm/io-unit.c @@ -41,9 +41,8 @@ iounit_init(int sbi_node, int io_node, struct sbus_bus *sbus) struct linux_prom_registers iommu_promregs[PROMREG_MAX]; struct resource r; - iounit = kmalloc(sizeof(struct iounit_struct), GFP_ATOMIC); + iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); - memset(iounit, 0, sizeof(*iounit)); iounit->limit[0] = IOUNIT_BMAP1_START; iounit->limit[1] = IOUNIT_BMAP2_START; iounit->limit[2] = IOUNIT_BMAPM_START;