diff options
author | Yinghai Lu <yinghai@kernel.org> | 2009-02-08 16:18:03 -0800 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-09 09:02:34 +0100 |
commit | 005bf0e6fa0e9543933fe2e36322af649df7cacb (patch) | |
tree | b14afa63f043d8c1fcf705b2d60262d873ec8f3f /kernel/irq/numa_migrate.c | |
parent | 0f3c2a89c1451cdf6328f99977bd9decd4f708e1 (diff) |
irq: optimize init_kstat_irqs/init_copy_kstat_irqs
Simplify and make init_kstat_irqs etc more type proof, suggested by
Andrew.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/numa_migrate.c')
-rw-r--r-- | kernel/irq/numa_migrate.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/kernel/irq/numa_migrate.c b/kernel/irq/numa_migrate.c index ecf765c6a77..c500cfe422b 100644 --- a/kernel/irq/numa_migrate.c +++ b/kernel/irq/numa_migrate.c @@ -17,16 +17,11 @@ static void init_copy_kstat_irqs(struct irq_desc *old_desc, struct irq_desc *desc, int cpu, int nr) { - unsigned long bytes; - init_kstat_irqs(desc, cpu, nr); - if (desc->kstat_irqs != old_desc->kstat_irqs) { - /* Compute how many bytes we need per irq and allocate them */ - bytes = nr * sizeof(unsigned int); - - memcpy(desc->kstat_irqs, old_desc->kstat_irqs, bytes); - } + if (desc->kstat_irqs != old_desc->kstat_irqs) + memcpy(desc->kstat_irqs, old_desc->kstat_irqs, + nr * sizeof(*desc->kstat_irqs)); } static void free_kstat_irqs(struct irq_desc *old_desc, struct irq_desc *desc) |