Commit cddf7ff7 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Thomas Gleixner

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: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent a850cef7
...@@ -1845,7 +1845,7 @@ static struct sysdev_class ioapic_sysdev_class = { ...@@ -1845,7 +1845,7 @@ static struct sysdev_class ioapic_sysdev_class = {
static int __init ioapic_init_sysfs(void) static int __init ioapic_init_sysfs(void)
{ {
struct sys_device * dev; struct sys_device * dev;
int i, size, error = 0; int i, size, error;
error = sysdev_class_register(&ioapic_sysdev_class); error = sysdev_class_register(&ioapic_sysdev_class);
if (error) if (error)
...@@ -1854,12 +1854,11 @@ static int __init ioapic_init_sysfs(void) ...@@ -1854,12 +1854,11 @@ static int __init ioapic_init_sysfs(void)
for (i = 0; i < nr_ioapics; i++ ) { for (i = 0; i < nr_ioapics; i++ ) {
size = sizeof(struct sys_device) + nr_ioapic_registers[i] size = sizeof(struct sys_device) + nr_ioapic_registers[i]
* sizeof(struct IO_APIC_route_entry); * sizeof(struct IO_APIC_route_entry);
mp_ioapic_data[i] = kmalloc(size, GFP_KERNEL); mp_ioapic_data[i] = kzalloc(size, GFP_KERNEL);
if (!mp_ioapic_data[i]) { if (!mp_ioapic_data[i]) {
printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i);
continue; continue;
} }
memset(mp_ioapic_data[i], 0, size);
dev = &mp_ioapic_data[i]->dev; dev = &mp_ioapic_data[i]->dev;
dev->id = i; dev->id = i;
dev->cls = &ioapic_sysdev_class; dev->cls = &ioapic_sysdev_class;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment