[PATCH] kzalloc() conversion in arch/ppc
authorEric Sesterhenn <snakebyte@gmx.de>
Mon, 6 Mar 2006 20:13:32 +0000 (21:13 +0100)
committerPaul Mackerras <paulus@samba.org>
Fri, 17 Mar 2006 02:20:57 +0000 (13:20 +1100)
This converts arch/ppc to kzalloc usage.
Crosscompile tested with allyesconfig.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/ppc/4xx_io/serial_sicc.c
arch/ppc/kernel/smp-tbsync.c
arch/ppc/platforms/katana.c
arch/ppc/platforms/radstone_ppc7d.c
arch/ppc/syslib/ocp.c

index 4dc6aa2abfc1ddc65cbf52538d7bc9c0cc22b070..98b25fa0049a2cbf561bee7400046f23b7976c1a 100644 (file)
@@ -1637,9 +1637,8 @@ static struct SICC_info *siccuart_get(int line)
     state->count++;
     if (state->info)
         return state->info;
-    info = kmalloc(sizeof(struct SICC_info), GFP_KERNEL);
+    info = kzalloc(sizeof(struct SICC_info), GFP_KERNEL);
     if (info) {
-        memset(info, 0, sizeof(struct SICC_info));
         init_waitqueue_head(&info->open_wait);
         init_waitqueue_head(&info->close_wait);
         init_waitqueue_head(&info->delta_msr_wait);
index 2c9cd95bcea6d9eb3cecd613826763c8ec6c5d36..6a5694fcc711efefdc063e9b53d905b82a091dab 100644 (file)
@@ -126,8 +126,7 @@ smp_generic_give_timebase( void )
        printk("Synchronizing timebase\n");
 
        /* if this fails then this kernel won't work anyway... */
-       tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL );
-       memset( tbsync, 0, sizeof(*tbsync) );
+       tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL );
        mb();
        running = 1;
 
index d2766617c3cb9ea9e5cf0580d0fc12772e572f6f..6f3bc6161746872b5a9e46d434abdb1395dfb926 100644 (file)
@@ -662,12 +662,11 @@ katana_setup_mtd(void)
 
        ptbl_entries = (size >= (64*MB)) ? 6 : 4;
 
-       if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition),
+       if ((ptbl = kcalloc(ptbl_entries, sizeof(struct mtd_partition),
                        GFP_KERNEL)) == NULL) {
                printk(KERN_WARNING "Can't alloc MTD partition table\n");
                return -ENOMEM;
        }
-       memset(ptbl, 0, ptbl_entries * sizeof(struct mtd_partition));
 
        ptbl[0].name = "Monitor";
        ptbl[0].size = KATANA_MTD_MONITOR_SIZE;
index 1b1e7c5ef1525d83f02943ba23c6ab6351b48552..30188085bd382f18315d1a9426ec8afae719f49a 100644 (file)
@@ -683,11 +683,10 @@ ppc7d_fixup_i2c_pdata(struct platform_device *pdev)
 
        pdata = pdev->dev.platform_data;
        if (pdata == NULL) {
-               pdata = kmalloc(sizeof(*pdata), GFP_KERNEL);
+               pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
                if (pdata == NULL)
                        return;
 
-               memset(pdata, 0, sizeof(*pdata));
                pdev->dev.platform_data = pdata;
        }
 
index 2fe28ded2c6096080be6bd0665135466dfc1e089..a4ecc2ee579ff781f567ef961aa6004b30b585da 100644 (file)
@@ -451,10 +451,9 @@ ocp_driver_init(void)
        DBG(("ocp: ocp_driver_init()...\n"));
 
        /* Allocate/register primary OCP bus */
-       ocp_bus = kmalloc(sizeof(struct device), GFP_KERNEL);
+       ocp_bus = kzalloc(sizeof(struct device), GFP_KERNEL);
        if (ocp_bus == NULL)
                return 1;
-       memset(ocp_bus, 0, sizeof(struct device));
        strcpy(ocp_bus->bus_id, "ocp");
 
        bus_register(&ocp_bus_type);