[<prev] [next>] [day] [month] [year] [list]
Message-ID: <cb3a4968538637aac3a5ae4f5ecc4f5eb43376ea.1760861877.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 19 Oct 2025 10:18:20 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H. Peter Anvin" <hpa@...or.com>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] x86/ioapic: Slightly simplify mp_irqdomain_alloc()
The return value of irq_find_mapping() is only tested, not used for
anything else.
So, this call can but replaced by a slightly simpler irq_resolve_mapping().
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
For the records and if interested with number, on x86_64, built with
allmodconfig, this also saves some byte-codes.
Before:
======
text data bss dec hex filename
82142 38633 18048 138823 21e47 arch/x86/kernel/apic/io_apic.o
After:
=====
text data bss dec hex filename
81932 38633 18048 138613 21d75 arch/x86/kernel/apic/io_apic.o
---
arch/x86/kernel/apic/io_apic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 5ba2feb2c04c..1e0442e867b1 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2864,7 +2864,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
ioapic = mp_irqdomain_ioapic_idx(domain);
pin = info->ioapic.pin;
- if (irq_find_mapping(domain, (irq_hw_number_t)pin) > 0)
+ if (irq_resolve_mapping(domain, (irq_hw_number_t)pin))
return -EEXIST;
data = kzalloc(sizeof(*data), GFP_KERNEL);
--
2.51.0
Powered by blists - more mailing lists