diff options
author | Mariusz Kozlowski <m.kozlowski@tuxland.pl> | 2007-10-17 12:04:38 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-17 14:16:18 -0400 |
commit | cddf7ff766ee53e24ff37f55a897efc90cb3526e (patch) | |
tree | 3741fd328f0ade843c4caca04b61274d439c0457 /arch | |
parent | a850cef77f148c2e305022a1ed86ca6cff5ee300 (diff) |
x86: kmalloc + memset conversion to kzalloc
arch/x86_64/kernel/io_apic.c | 56080 -> 56038 (-42 bytes)
also eliminate unnecessary local variable assignment.
[ tglx: arch/x86 adaptation ]
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/io_apic_64.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index 966fa1062491..66a27d268d9a 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -1845,7 +1845,7 @@ static struct sysdev_class ioapic_sysdev_class = { | |||
1845 | static int __init ioapic_init_sysfs(void) | 1845 | static int __init ioapic_init_sysfs(void) |
1846 | { | 1846 | { |
1847 | struct sys_device * dev; | 1847 | struct sys_device * dev; |
1848 | int i, size, error = 0; | 1848 | int i, size, error; |
1849 | 1849 | ||
1850 | error = sysdev_class_register(&ioapic_sysdev_class); | 1850 | error = sysdev_class_register(&ioapic_sysdev_class); |
1851 | if (error) | 1851 | if (error) |
@@ -1854,12 +1854,11 @@ static int __init ioapic_init_sysfs(void) | |||
1854 | for (i = 0; i < nr_ioapics; i++ ) { | 1854 | for (i = 0; i < nr_ioapics; i++ ) { |
1855 | size = sizeof(struct sys_device) + nr_ioapic_registers[i] | 1855 | size = sizeof(struct sys_device) + nr_ioapic_registers[i] |
1856 | * sizeof(struct IO_APIC_route_entry); | 1856 | * sizeof(struct IO_APIC_route_entry); |
1857 | mp_ioapic_data[i] = kmalloc(size, GFP_KERNEL); | 1857 | mp_ioapic_data[i] = kzalloc(size, GFP_KERNEL); |
1858 | if (!mp_ioapic_data[i]) { | 1858 | if (!mp_ioapic_data[i]) { |
1859 | printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); | 1859 | printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); |
1860 | continue; | 1860 | continue; |
1861 | } | 1861 | } |
1862 | memset(mp_ioapic_data[i], 0, size); | ||
1863 | dev = &mp_ioapic_data[i]->dev; | 1862 | dev = &mp_ioapic_data[i]->dev; |
1864 | dev->id = i; | 1863 | dev->id = i; |
1865 | dev->cls = &ioapic_sysdev_class; | 1864 | dev->cls = &ioapic_sysdev_class; |