lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1ce680114cdb8d40b072c54d7f015696a540e5a6.1760863194.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 19 Oct 2025 10:40:08 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org,
	Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: [PATCH] genirq/msi: Slightly simplify msi_domain_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
  44231	   5172	    256	  49659	   c1fb	kernel/irq/msi.o

After:
=====
   text	   data	    bss	    dec	    hex	filename
  44026	   5172	    256	  49454	   c12e	kernel/irq/msi.o
---
 kernel/irq/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/irq/msi.c b/kernel/irq/msi.c
index e7ad99254841..68886881fe10 100644
--- a/kernel/irq/msi.c
+++ b/kernel/irq/msi.c
@@ -706,7 +706,7 @@ static int msi_domain_alloc(struct irq_domain *domain, unsigned int virq,
 	irq_hw_number_t hwirq = ops->get_hwirq(info, arg);
 	int i, ret;
 
-	if (irq_find_mapping(domain, hwirq) > 0)
+	if (irq_resolve_mapping(domain, hwirq))
 		return -EEXIST;
 
 	if (domain->parent) {
-- 
2.51.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ