Skip to contentSkip to conversation

x86/IO-APIC: replace redundant irq_trigger() call

PATCH In review Jan Beulich 2 participants 2 messages Aug 26

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/IO-APIC: replace redundant irq_trigger() call

Just having called the function and stored the result, there's no point in calling it again right away with the same argument; the stored result can be used instead. And the stored result also doesn't need overwriting again with the same value.

No functional change intended.

xen/arch/x86/io_apic.c +1 -3
@@ -1089,10 +1089,8 @@ static void __init setup_IO_APIC_irqs(vo
             entry.trigger = irq_trigger(idx);
             entry.polarity = irq_polarity(idx);
 
-            if (irq_trigger(idx)) {
-                entry.trigger = 1;
+            if (entry.trigger)
                 entry.mask = 1;
-            }
 
             irq = pin_2_irq(idx, apic, pin);
 
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Jan Beulich

Just having called the function and stored the result, there's no point in calling it again right away with the same argument; the stored result can be used instead. And the stored result also doesn't need overwriting again with the same value.

No functional change intended.