Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, ioapic: Factor out print_IO_APIC() to only print one io apic

It is getting too big after the interrupt remaping entries debug
print out was added.

Original print_IO_APIC() becomes print_IO_APICs().
New print_IO_APIC() will only print one ioapic's registers

As a side-effect this clean-up also made checkpatch.pl happier.

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Naga Chumbalkar <nagananda.chumbalkar@hp.com>
Cc: Suresh Siddha <suresh.b.siddha@intel.com>
Link: http://lkml.kernel.org/r/4E9542D3.5000008@oracle.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Yinghai Lu and committed by
Ingo Molnar
cda417dd 3a61d7fe

+24 -22
+24 -22
arch/x86/kernel/apic/io_apic.c
··· 1512 1512 ioapic_write_entry(apic_id, pin, entry); 1513 1513 } 1514 1514 1515 - 1516 - __apicdebuginit(void) print_IO_APIC(void) 1515 + __apicdebuginit(void) print_IO_APIC(int apic) 1517 1516 { 1518 - int apic, i; 1517 + int i; 1519 1518 union IO_APIC_reg_00 reg_00; 1520 1519 union IO_APIC_reg_01 reg_01; 1521 1520 union IO_APIC_reg_02 reg_02; 1522 1521 union IO_APIC_reg_03 reg_03; 1523 1522 unsigned long flags; 1524 - struct irq_cfg *cfg; 1525 - unsigned int irq; 1526 - 1527 - printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1528 - for (i = 0; i < nr_ioapics; i++) 1529 - printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", 1530 - mpc_ioapic_id(i), ioapics[i].nr_registers); 1531 - 1532 - /* 1533 - * We are a bit conservative about what we expect. We have to 1534 - * know about every hardware change ASAP. 1535 - */ 1536 - printk(KERN_INFO "testing the IO APIC.......................\n"); 1537 - 1538 - for (apic = 0; apic < nr_ioapics; apic++) { 1539 1523 1540 1524 raw_spin_lock_irqsave(&ioapic_lock, flags); 1541 1525 reg_00.raw = io_apic_read(apic, 0); ··· 1620 1636 ); 1621 1637 } 1622 1638 } 1623 - } 1639 + } 1640 + 1641 + __apicdebuginit(void) print_IO_APICs(void) 1642 + { 1643 + int apic, i; 1644 + struct irq_cfg *cfg; 1645 + unsigned int irq; 1646 + 1647 + printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries); 1648 + for (i = 0; i < nr_ioapics; i++) 1649 + printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n", 1650 + mpc_ioapic_id(i), ioapics[i].nr_registers); 1651 + 1652 + /* 1653 + * We are a bit conservative about what we expect. We have to 1654 + * know about every hardware change ASAP. 1655 + */ 1656 + printk(KERN_INFO "testing the IO APIC.......................\n"); 1657 + 1658 + for (apic = 0; apic < nr_ioapics; apic++) 1659 + print_IO_APIC(apic); 1624 1660 1625 1661 printk(KERN_DEBUG "IRQ to pin mappings:\n"); 1626 1662 for_each_active_irq(irq) { ··· 1659 1655 } 1660 1656 1661 1657 printk(KERN_INFO ".................................... done.\n"); 1662 - 1663 - return; 1664 1658 } 1665 1659 1666 1660 __apicdebuginit(void) print_APIC_field(int base) ··· 1852 1850 return 0; 1853 1851 1854 1852 print_local_APICs(show_lapic); 1855 - print_IO_APIC(); 1853 + print_IO_APICs(); 1856 1854 1857 1855 return 0; 1858 1856 }