diff options
author | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-06-08 03:32:15 -0700 |
---|---|---|
committer | Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com> | 2009-07-14 13:32:50 -0700 |
commit | 4eea6fff612f54380dd642b045bf03ac0613fe3e (patch) | |
tree | e3b28e7b23070ce6e871114875256e77585ea8e0 | |
parent | 535b64291a9d1ff8bc54642494a5fce27e1e1170 (diff) | |
download | kernel_samsung_tuna-4eea6fff612f54380dd642b045bf03ac0613fe3e.zip kernel_samsung_tuna-4eea6fff612f54380dd642b045bf03ac0613fe3e.tar.gz kernel_samsung_tuna-4eea6fff612f54380dd642b045bf03ac0613fe3e.tar.bz2 |
x86/ioapic.c: clean up replace_pin_at_irq_node logic and comments
There's no need for a control variable in replace_pin_at_irq_node();
it can just return if it finds the old apic/pin to replace.
If the loop terminates, then it didn't find the old apic/pin, so it can
add the new ones.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 9386976..8245e62 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -512,25 +512,22 @@ static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin * Reroute an IRQ to a different pin. */ static void __init replace_pin_at_irq_node(struct irq_cfg *cfg, int node, - int oldapic, int oldpin, - int newapic, int newpin) + int oldapic, int oldpin, + int newapic, int newpin) { struct irq_pin_list *entry; - int replaced = 0; for (entry = cfg->irq_2_pin; entry != NULL; entry = entry->next) { if (entry->apic == oldapic && entry->pin == oldpin) { entry->apic = newapic; entry->pin = newpin; - replaced = 1; /* every one is different, right? */ - break; + return; } } - /* why? call replace before add? */ - if (!replaced) - add_pin_to_irq_node(cfg, node, newapic, newpin); + /* old apic/pin didn't exist, so just add new ones */ + add_pin_to_irq_node(cfg, node, newapic, newpin); } static void io_apic_modify_irq(struct irq_cfg *cfg, |