public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: JAILLET Christophe <jaillet.christophe@wanadoo.fr>
To: linux <linux-kernel@vger.kernel.org>, cj <jaillet.christophe@wanadoo.fr>
Subject: [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset
Date: Sun, 22 Jun 2008 18:03:24 +0200	[thread overview]
Message-ID: <485E77CC.20604@wanadoo.fr> (raw)

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;



             reply	other threads:[~2008-06-22 16:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 16:03 JAILLET Christophe [this message]
2008-06-24 12:17 ` [PATCH 1/1] arch/x86/kernel/io_apic_32.c : use kzalloc instead of kmalloc/memset Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2008-06-22 20:13 JAILLET Christophe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=485E77CC.20604@wanadoo.fr \
    --to=jaillet.christophe@wanadoo.fr \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox