diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-03-06 15:13:32 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-16 21:20:57 -0500 |
commit | d116fe5aeafd8226712d2de9c69428725ca74474 (patch) | |
tree | 5c65b1b18d495ac9d16e875a7a4f99863ffe0edb /arch/ppc | |
parent | 0f6be7b77ceaea01a35b37fab26f4ea3b01efe14 (diff) |
[PATCH] kzalloc() conversion in arch/ppc
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>
Diffstat (limited to 'arch/ppc')
-rw-r--r-- | arch/ppc/4xx_io/serial_sicc.c | 3 | ||||
-rw-r--r-- | arch/ppc/kernel/smp-tbsync.c | 3 | ||||
-rw-r--r-- | arch/ppc/platforms/katana.c | 3 | ||||
-rw-r--r-- | arch/ppc/platforms/radstone_ppc7d.c | 3 | ||||
-rw-r--r-- | arch/ppc/syslib/ocp.c | 3 |
5 files changed, 5 insertions, 10 deletions
diff --git a/arch/ppc/4xx_io/serial_sicc.c b/arch/ppc/4xx_io/serial_sicc.c index 4dc6aa2abfc1..98b25fa0049a 100644 --- a/arch/ppc/4xx_io/serial_sicc.c +++ b/arch/ppc/4xx_io/serial_sicc.c | |||
@@ -1637,9 +1637,8 @@ static struct SICC_info *siccuart_get(int line) | |||
1637 | state->count++; | 1637 | state->count++; |
1638 | if (state->info) | 1638 | if (state->info) |
1639 | return state->info; | 1639 | return state->info; |
1640 | info = kmalloc(sizeof(struct SICC_info), GFP_KERNEL); | 1640 | info = kzalloc(sizeof(struct SICC_info), GFP_KERNEL); |
1641 | if (info) { | 1641 | if (info) { |
1642 | memset(info, 0, sizeof(struct SICC_info)); | ||
1643 | init_waitqueue_head(&info->open_wait); | 1642 | init_waitqueue_head(&info->open_wait); |
1644 | init_waitqueue_head(&info->close_wait); | 1643 | init_waitqueue_head(&info->close_wait); |
1645 | init_waitqueue_head(&info->delta_msr_wait); | 1644 | init_waitqueue_head(&info->delta_msr_wait); |
diff --git a/arch/ppc/kernel/smp-tbsync.c b/arch/ppc/kernel/smp-tbsync.c index 2c9cd95bcea6..6a5694fcc711 100644 --- a/arch/ppc/kernel/smp-tbsync.c +++ b/arch/ppc/kernel/smp-tbsync.c | |||
@@ -126,8 +126,7 @@ smp_generic_give_timebase( void ) | |||
126 | printk("Synchronizing timebase\n"); | 126 | printk("Synchronizing timebase\n"); |
127 | 127 | ||
128 | /* if this fails then this kernel won't work anyway... */ | 128 | /* if this fails then this kernel won't work anyway... */ |
129 | tbsync = kmalloc( sizeof(*tbsync), GFP_KERNEL ); | 129 | tbsync = kzalloc( sizeof(*tbsync), GFP_KERNEL ); |
130 | memset( tbsync, 0, sizeof(*tbsync) ); | ||
131 | mb(); | 130 | mb(); |
132 | running = 1; | 131 | running = 1; |
133 | 132 | ||
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c index d2766617c3cb..6f3bc6161746 100644 --- a/arch/ppc/platforms/katana.c +++ b/arch/ppc/platforms/katana.c | |||
@@ -662,12 +662,11 @@ katana_setup_mtd(void) | |||
662 | 662 | ||
663 | ptbl_entries = (size >= (64*MB)) ? 6 : 4; | 663 | ptbl_entries = (size >= (64*MB)) ? 6 : 4; |
664 | 664 | ||
665 | if ((ptbl = kmalloc(ptbl_entries * sizeof(struct mtd_partition), | 665 | if ((ptbl = kcalloc(ptbl_entries, sizeof(struct mtd_partition), |
666 | GFP_KERNEL)) == NULL) { | 666 | GFP_KERNEL)) == NULL) { |
667 | printk(KERN_WARNING "Can't alloc MTD partition table\n"); | 667 | printk(KERN_WARNING "Can't alloc MTD partition table\n"); |
668 | return -ENOMEM; | 668 | return -ENOMEM; |
669 | } | 669 | } |
670 | memset(ptbl, 0, ptbl_entries * sizeof(struct mtd_partition)); | ||
671 | 670 | ||
672 | ptbl[0].name = "Monitor"; | 671 | ptbl[0].name = "Monitor"; |
673 | ptbl[0].size = KATANA_MTD_MONITOR_SIZE; | 672 | ptbl[0].size = KATANA_MTD_MONITOR_SIZE; |
diff --git a/arch/ppc/platforms/radstone_ppc7d.c b/arch/ppc/platforms/radstone_ppc7d.c index 1b1e7c5ef152..30188085bd38 100644 --- a/arch/ppc/platforms/radstone_ppc7d.c +++ b/arch/ppc/platforms/radstone_ppc7d.c | |||
@@ -683,11 +683,10 @@ ppc7d_fixup_i2c_pdata(struct platform_device *pdev) | |||
683 | 683 | ||
684 | pdata = pdev->dev.platform_data; | 684 | pdata = pdev->dev.platform_data; |
685 | if (pdata == NULL) { | 685 | if (pdata == NULL) { |
686 | pdata = kmalloc(sizeof(*pdata), GFP_KERNEL); | 686 | pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); |
687 | if (pdata == NULL) | 687 | if (pdata == NULL) |
688 | return; | 688 | return; |
689 | 689 | ||
690 | memset(pdata, 0, sizeof(*pdata)); | ||
691 | pdev->dev.platform_data = pdata; | 690 | pdev->dev.platform_data = pdata; |
692 | } | 691 | } |
693 | 692 | ||
diff --git a/arch/ppc/syslib/ocp.c b/arch/ppc/syslib/ocp.c index 2fe28ded2c60..a4ecc2ee579f 100644 --- a/arch/ppc/syslib/ocp.c +++ b/arch/ppc/syslib/ocp.c | |||
@@ -451,10 +451,9 @@ ocp_driver_init(void) | |||
451 | DBG(("ocp: ocp_driver_init()...\n")); | 451 | DBG(("ocp: ocp_driver_init()...\n")); |
452 | 452 | ||
453 | /* Allocate/register primary OCP bus */ | 453 | /* Allocate/register primary OCP bus */ |
454 | ocp_bus = kmalloc(sizeof(struct device), GFP_KERNEL); | 454 | ocp_bus = kzalloc(sizeof(struct device), GFP_KERNEL); |
455 | if (ocp_bus == NULL) | 455 | if (ocp_bus == NULL) |
456 | return 1; | 456 | return 1; |
457 | memset(ocp_bus, 0, sizeof(struct device)); | ||
458 | strcpy(ocp_bus->bus_id, "ocp"); | 457 | strcpy(ocp_bus->bus_id, "ocp"); |
459 | 458 | ||
460 | bus_register(&ocp_bus_type); | 459 | bus_register(&ocp_bus_type); |