aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/hotplug/cpqphp.h
diff options
context:
space:
mode:
authorAlex Chiang <achiang@hp.com>2009-03-31 11:24:02 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-06-11 15:04:14 -0400
commitb019ee679afde950f2d01b1af0530453aa60af3f (patch)
treed6f2cea2323cbd0b8b403ab59eec9f527a0ab026 /drivers/pci/hotplug/cpqphp.h
parent1d2e8b1c58ef96b8834b139caf4357effedcb5ab (diff)
PCI Hotplug: cpqphp: clean up accesses to pcibios_get_irq_routing_table()
Instead of making multiple calls to pcibios_get_irq_routing_table, let's just do it once and save the answer. The reason we were making multiple calls is because we liked to calculate its length and perform some loop over it. Instead of open-coding the length calculation every time, provide it in an inline helper function. Finally, since pci_print_IRQ_route() is used only for debug, let's only do it when cpqhp_debug is set. Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/cpqphp.h')
-rw-r--r--drivers/pci/hotplug/cpqphp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h
index 308f82b1fc9a..1d5561c6bad4 100644
--- a/drivers/pci/hotplug/cpqphp.h
+++ b/drivers/pci/hotplug/cpqphp.h
@@ -455,6 +455,7 @@ extern int cpqhp_debug;
455extern int cpqhp_legacy_mode; 455extern int cpqhp_legacy_mode;
456extern struct controller *cpqhp_ctrl_list; 456extern struct controller *cpqhp_ctrl_list;
457extern struct pci_func *cpqhp_slot_list[256]; 457extern struct pci_func *cpqhp_slot_list[256];
458extern struct irq_routing_table *cpqhp_routing_table;
458 459
459/* these can be gotten rid of, but for debugging they are purty */ 460/* these can be gotten rid of, but for debugging they are purty */
460extern u8 cpqhp_nic_irq; 461extern u8 cpqhp_nic_irq;
@@ -733,4 +734,12 @@ static inline int wait_for_ctrl_irq(struct controller *ctrl)
733 return retval; 734 return retval;
734} 735}
735 736
737#include <asm/pci_x86.h>
738static inline int cpqhp_routing_table_length(void)
739{
740 BUG_ON(cpqhp_routing_table == NULL);
741 return ((cpqhp_routing_table->size - sizeof(struct irq_routing_table)) /
742 sizeof(struct irq_info));
743}
744
736#endif 745#endif