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

Jan Beulich posted 1 patch 1 week ago
[PATCH] x86/IO-APIC: replace redundant irq_trigger() call
Posted by Jan Beulich 1 week ago
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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/io_apic.c
+++ b/xen/arch/x86/io_apic.c
@@ -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);
Re: [PATCH] x86/IO-APIC: replace redundant irq_trigger() call
Posted by Andrew Cooper 1 week ago
On 26/08/2026 3:40 pm, Jan Beulich wrote:
> 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.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>