Skip to content

Commit ee64510

Browse files
committed
x86/ioapic: Move replace_pin_at_irq_node() to the call site
It's only used by check_timer(). Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Qiuxu Zhuo <[email protected]> Tested-by: Breno Leitao <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 48855a2 commit ee64510

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

arch/x86/kernel/apic/io_apic.c

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -370,28 +370,6 @@ static void __remove_pin_from_irq(struct mp_chip_data *data, int apic, int pin)
370370
}
371371
}
372372

373-
/*
374-
* Reroute an IRQ to a different pin.
375-
*/
376-
static void __init replace_pin_at_irq_node(struct mp_chip_data *data, int node,
377-
int oldapic, int oldpin,
378-
int newapic, int newpin)
379-
{
380-
struct irq_pin_list *entry;
381-
382-
for_each_irq_pin(entry, data->irq_2_pin) {
383-
if (entry->apic == oldapic && entry->pin == oldpin) {
384-
entry->apic = newapic;
385-
entry->pin = newpin;
386-
/* every one is different, right? */
387-
return;
388-
}
389-
}
390-
391-
/* old apic/pin didn't exist, so just add new ones */
392-
add_pin_to_irq_node(data, node, newapic, newpin);
393-
}
394-
395373
static void io_apic_modify_irq(struct mp_chip_data *data, bool masked,
396374
void (*final)(struct irq_pin_list *entry))
397375
{
@@ -2067,6 +2045,24 @@ static int __init mp_alloc_timer_irq(int ioapic, int pin)
20672045
return irq;
20682046
}
20692047

2048+
static void __init replace_pin_at_irq_node(struct mp_chip_data *data, int node,
2049+
int oldapic, int oldpin,
2050+
int newapic, int newpin)
2051+
{
2052+
struct irq_pin_list *entry;
2053+
2054+
for_each_irq_pin(entry, data->irq_2_pin) {
2055+
if (entry->apic == oldapic && entry->pin == oldpin) {
2056+
entry->apic = newapic;
2057+
entry->pin = newpin;
2058+
return;
2059+
}
2060+
}
2061+
2062+
/* Old apic/pin didn't exist, so just add a new one */
2063+
add_pin_to_irq_node(data, node, newapic, newpin);
2064+
}
2065+
20702066
/*
20712067
* This code may look a bit paranoid, but it's supposed to cooperate with
20722068
* a wide range of boards and BIOS bugs. Fortunately only the timer IRQ

0 commit comments

Comments
 (0)