aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-06-08 06:32:15 -0400
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>2009-07-14 16:32:50 -0400
commit4eea6fff612f54380dd642b045bf03ac0613fe3e (patch)
treee3b28e7b23070ce6e871114875256e77585ea8e0 /arch/x86/kernel/apic
parent535b64291a9d1ff8bc54642494a5fce27e1e1170 (diff)
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>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/io_apic.c13
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 9386976b675b..8245e62ed93f 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
512 * Reroute an IRQ to a different pin. 512 * Reroute an IRQ to a different pin.
513 */ 513 */
514static void __init replace_pin_at_irq_node(struct irq_cfg *cfg, int node, 514static void __init replace_pin_at_irq_node(struct irq_cfg *cfg, int node,
515 int oldapic, int oldpin, 515 int oldapic, int oldpin,
516 int newapic, int newpin) 516 int newapic, int newpin)
517{ 517{
518 struct irq_pin_list *entry; 518 struct irq_pin_list *entry;
519 int replaced = 0;
520 519
521 for (entry = cfg->irq_2_pin; entry != NULL; entry = entry->next) { 520 for (entry = cfg->irq_2_pin; entry != NULL; entry = entry->next) {
522 if (entry->apic == oldapic && entry->pin == oldpin) { 521 if (entry->apic == oldapic && entry->pin == oldpin) {
523 entry->apic = newapic; 522 entry->apic = newapic;
524 entry->pin = newpin; 523 entry->pin = newpin;
525 replaced = 1;
526 /* every one is different, right? */ 524 /* every one is different, right? */
527 break; 525 return;
528 } 526 }
529 } 527 }
530 528
531 /* why? call replace before add? */ 529 /* old apic/pin didn't exist, so just add new ones */
532 if (!replaced) 530 add_pin_to_irq_node(cfg, node, newapic, newpin);
533 add_pin_to_irq_node(cfg, node, newapic, newpin);
534} 531}
535 532
536static void io_apic_modify_irq(struct irq_cfg *cfg, 533static void io_apic_modify_irq(struct irq_cfg *cfg,