aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2010-09-28 17:31:50 -0400
committerThomas Gleixner <tglx@linutronix.de>2010-10-12 10:53:39 -0400
commit7e495529b62cf462eb2d8875fe15ca446b8e1f94 (patch)
tree53db590e868280775e03d8420671c5327b4e7d5a
parentbe5b7bf73802a9391158d9fcc0bc6b07670c73a5 (diff)
x86: ioapic: Cleanup some more
Cleanup after the irq_chip conversion a bit. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/apic/io_apic.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index b144f7a95970..43030995dcce 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -131,13 +131,9 @@ struct irq_pin_list {
131 struct irq_pin_list *next; 131 struct irq_pin_list *next;
132}; 132};
133 133
134static struct irq_pin_list *get_one_free_irq_2_pin(int node) 134static struct irq_pin_list *alloc_irq_pin_list(int node)
135{ 135{
136 struct irq_pin_list *pin; 136 return kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node);
137
138 pin = kzalloc_node(sizeof(*pin), GFP_ATOMIC, node);
139
140 return pin;
141} 137}
142 138
143/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */ 139/* irq_cfg is indexed by the sum of all RTEs in all I/O APICs. */
@@ -232,7 +228,7 @@ init_copy_irq_2_pin(struct irq_cfg *old_cfg, struct irq_cfg *cfg, int node)
232 if (!old_entry) 228 if (!old_entry)
233 return; 229 return;
234 230
235 entry = get_one_free_irq_2_pin(node); 231 entry = alloc_irq_pin_list(node);
236 if (!entry) 232 if (!entry)
237 return; 233 return;
238 234
@@ -242,7 +238,7 @@ init_copy_irq_2_pin(struct irq_cfg *old_cfg, struct irq_cfg *cfg, int node)
242 tail = entry; 238 tail = entry;
243 old_entry = old_entry->next; 239 old_entry = old_entry->next;
244 while (old_entry) { 240 while (old_entry) {
245 entry = get_one_free_irq_2_pin(node); 241 entry = alloc_irq_pin_list(node);
246 if (!entry) { 242 if (!entry) {
247 entry = head; 243 entry = head;
248 while (entry) { 244 while (entry) {
@@ -471,7 +467,7 @@ static void ioapic_mask_entry(int apic, int pin)
471 * fast in the common case, and fast for shared ISA-space IRQs. 467 * fast in the common case, and fast for shared ISA-space IRQs.
472 */ 468 */
473static int 469static int
474add_pin_to_irq_node_nopanic(struct irq_cfg *cfg, int node, int apic, int pin) 470__add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin)
475{ 471{
476 struct irq_pin_list **last, *entry; 472 struct irq_pin_list **last, *entry;
477 473
@@ -483,7 +479,7 @@ add_pin_to_irq_node_nopanic(struct irq_cfg *cfg, int node, int apic, int pin)
483 last = &entry->next; 479 last = &entry->next;
484 } 480 }
485 481
486 entry = get_one_free_irq_2_pin(node); 482 entry = alloc_irq_pin_list(node);
487 if (!entry) { 483 if (!entry) {
488 printk(KERN_ERR "can not alloc irq_pin_list (%d,%d,%d)\n", 484 printk(KERN_ERR "can not alloc irq_pin_list (%d,%d,%d)\n",
489 node, apic, pin); 485 node, apic, pin);
@@ -498,7 +494,7 @@ add_pin_to_irq_node_nopanic(struct irq_cfg *cfg, int node, int apic, int pin)
498 494
499static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin) 495static void add_pin_to_irq_node(struct irq_cfg *cfg, int node, int apic, int pin)
500{ 496{
501 if (add_pin_to_irq_node_nopanic(cfg, node, apic, pin)) 497 if (__add_pin_to_irq_node(cfg, node, apic, pin))
502 panic("IO-APIC: failed to add irq-pin. Can not proceed\n"); 498 panic("IO-APIC: failed to add irq-pin. Can not proceed\n");
503} 499}
504 500
@@ -3801,7 +3797,7 @@ static int __io_apic_set_pci_routing(struct device *dev, int irq,
3801 * IRQs < 16 are already in the irq_2_pin[] map 3797 * IRQs < 16 are already in the irq_2_pin[] map
3802 */ 3798 */
3803 if (irq >= legacy_pic->nr_legacy_irqs) { 3799 if (irq >= legacy_pic->nr_legacy_irqs) {
3804 if (add_pin_to_irq_node_nopanic(cfg, node, ioapic, pin)) { 3800 if (__add_pin_to_irq_node(cfg, node, ioapic, pin)) {
3805 printk(KERN_INFO "can not add pin %d for irq %d\n", 3801 printk(KERN_INFO "can not add pin %d for irq %d\n",
3806 pin, irq); 3802 pin, irq);
3807 return 0; 3803 return 0;