linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] No need to call irq_domain_legacy_revmap() for twice
@ 2012-09-24  9:37 Mike Qiu
  2012-10-10  5:41 ` Mike
  2012-11-26 20:17 ` Grant Likely
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Qiu @ 2012-09-24  9:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: tglx, benh, grant.likely, Mike Qiu

Function irq_create_mapping() calls irq_find_mapping(). The later
function has checked if the indicated IRQ domain has hw IRQ mapped to
virtual IRQ through legacy mode or not and return the value of the
legacy irq number by call irq_domain_legacy_revmap(). We needn't
to call irq_domain_legacy_revmap() to do same check in
irq_create_mapping() again.

The patch removes the duplicate call.

Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
---
 kernel/irq/irqdomain.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 49a7772..286d672 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -547,9 +547,12 @@ unsigned int irq_create_mapping(struct irq_domain *domain,
 		return virq;
 	}
 
-	/* Get a virtual interrupt number */
+	/*
+	 * For IRQ domain with type of IRQ_DOMAIN_MAP_LEGACY, we needn't
+	 * create the IRQ mapping for non-existing one, so just return 0.
+	 */
 	if (domain->revmap_type == IRQ_DOMAIN_MAP_LEGACY)
-		return irq_domain_legacy_revmap(domain, hwirq);
+		return 0;
 
 	/* Allocate a virtual interrupt number */
 	hint = hwirq % nr_irqs;
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-06-05 22:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-24  9:37 [PATCH] No need to call irq_domain_legacy_revmap() for twice Mike Qiu
2012-10-10  5:41 ` Mike
2012-11-26 20:17 ` Grant Likely
2012-11-27  1:41   ` Mike
2012-12-11  8:30     ` Grant Likely
2012-12-11  8:50       ` Mike
2013-04-17  6:48       ` Mike
2013-06-05 22:46         ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).