* [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset
@ 2008-06-22 16:03 JAILLET Christophe
2008-06-24 12:17 ` Ingo Molnar
0 siblings, 1 reply; 3+ messages in thread
From: JAILLET Christophe @ 2008-06-22 16:03 UTC (permalink / raw)
To: linux, cj
From: Christophe Jaillet <jaillet.?christophe@wanadoo.fr>
Hi, here is a patch against arch/x86/kernel/io_apic_32.c which :
1) replace kmalloc/memset with equivalent kzalloc.
Signed-off-by: Christophe Jaillet <jaillet.?christophe@wanadoo.fr>
---
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 4dc8600..cb9bbeb 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -699,14 +699,12 @@ static int __init balanced_irq_init(void)
physical_balance = 1;
for_each_online_cpu(i) {
- irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS,
GFP_KERNEL);
- irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS,
GFP_KERNEL);
+ irq_cpu_data[i].irq_delta = kzalloc(sizeof(unsigned long) * NR_IRQS,
GFP_KERNEL);
+ irq_cpu_data[i].last_irq = kzalloc(sizeof(unsigned long) * NR_IRQS,
GFP_KERNEL);
if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) {
printk(KERN_ERR "balanced_irq_init: out of memory");
goto failed;
}
- memset(irq_cpu_data[i].irq_delta,0,sizeof(unsigned long) * NR_IRQS);
- memset(irq_cpu_data[i].last_irq,0,sizeof(unsigned long) * NR_IRQS);
}
printk(KERN_INFO "Starting balanced_irq\n");
@@ -2376,12 +2374,11 @@ static int __init ioapic_init_sysfs(void)
for (i = 0; i < nr_ioapics; i++ ) {
size = sizeof(struct sys_device) + nr_ioapic_registers[i]
* 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]) {
printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i);
continue;
}
- memset(mp_ioapic_data[i], 0, size);
dev = &mp_ioapic_data[i]->dev;
dev->id = i;
dev->cls = &ioapic_sysdev_class;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset
@ 2008-06-22 20:13 JAILLET Christophe
0 siblings, 0 replies; 3+ messages in thread
From: JAILLET Christophe @ 2008-06-22 20:13 UTC (permalink / raw)
To: linux, cj, petero2
From: Christophe Jaillet <jaillet.christophe@wanadoo.fr>
Hi, here is a patch against arch/x86/kernel/io_apic_32.c which :
1) replace kmalloc/memset with equivalent kzalloc.
It is the same patch as the one I sent earlier but the formating should be OK this time.
Signed-off-by: Christophe Jaillet <jaillet.christophe@wanadoo.fr>
---
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 4dc8600..cb9bbeb 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -699,14 +699,12 @@ static int __init balanced_irq_init(void)
physical_balance = 1;
for_each_online_cpu(i) {
- irq_cpu_data[i].irq_delta = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
- irq_cpu_data[i].last_irq = kmalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
+ irq_cpu_data[i].irq_delta = kzalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
+ irq_cpu_data[i].last_irq = kzalloc(sizeof(unsigned long) * NR_IRQS, GFP_KERNEL);
if (irq_cpu_data[i].irq_delta == NULL || irq_cpu_data[i].last_irq == NULL) {
printk(KERN_ERR "balanced_irq_init: out of memory");
goto failed;
}
- memset(irq_cpu_data[i].irq_delta,0,sizeof(unsigned long) * NR_IRQS);
- memset(irq_cpu_data[i].last_irq,0,sizeof(unsigned long) * NR_IRQS);
}
printk(KERN_INFO "Starting balanced_irq\n");
@@ -2376,12 +2374,11 @@ static int __init ioapic_init_sysfs(void)
for (i = 0; i < nr_ioapics; i++ ) {
size = sizeof(struct sys_device) + nr_ioapic_registers[i]
* 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]) {
printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i);
continue;
}
- memset(mp_ioapic_data[i], 0, size);
dev = &mp_ioapic_data[i]->dev;
dev->id = i;
dev->cls = &ioapic_sysdev_class;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset
2008-06-22 16:03 JAILLET Christophe
@ 2008-06-24 12:17 ` Ingo Molnar
0 siblings, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2008-06-24 12:17 UTC (permalink / raw)
To: JAILLET Christophe; +Cc: linux, the arch/x86 maintainers
* JAILLET Christophe <jaillet.christophe@wanadoo.fr> wrote:
> From: Christophe Jaillet <jaillet.?christophe@wanadoo.fr>
>
> Hi, here is a patch against arch/x86/kernel/io_apic_32.c which :
>
> 1) replace kmalloc/memset with equivalent kzalloc.
applied to tip/x86/apic - thanks Christophe.
There were some other changes in this area so i did a manual merge of
your changes. You can see/track your commit via tip/master:
http://people.redhat.com/mingo/tip.git/README
Ingo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-06-24 12:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22 20:13 [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset JAILLET Christophe
-- strict thread matches above, loose matches on Subject: below --
2008-06-22 16:03 JAILLET Christophe
2008-06-24 12:17 ` Ingo Molnar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox