[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210520163751.27325-20-maz@kernel.org>
Date: Thu, 20 May 2021 17:37:31 +0100
From: Marc Zyngier <maz@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>,
Michael Ellerman <mpe@...erman.id.au>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
Paul Mackerras <paulus@...ba.org>,
Ley Foon Tan <ley.foon.tan@...el.com>,
Chris Zankel <chris@...kel.net>,
Max Filippov <jcmvbkbc@...il.com>,
Vineet Gupta <vgupta@...opsys.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
Russell King <linux@...linux.org.uk>,
Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
Yoshinori Sato <ysato@...rs.sourceforge.jp>,
Rich Felker <dalias@...c.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Rob Clark <robdclark@...il.com>,
Linus Walleij <linus.walleij@...aro.org>,
Lee Jones <lee.jones@...aro.org>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
kernel-team@...roid.com
Subject: [PATCH 19/39] irqdomain: Implement irq_domain_clear_mapping() with irq_domain_set_mapping()
Now that we only deal with irq_data pointers, it is pretty obvious
that irq_domain_clear_mapping() and irq_domain_set_mapping() are
almost the exact same thing.
Implement one it terms of the other.
Signed-off-by: Marc Zyngier <maz@...nel.org>
---
kernel/irq/irqdomain.c | 21 ++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 7a4e38804487..ed2ffffc6fc6 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -498,21 +498,6 @@ static bool irq_domain_is_nomap(struct irq_domain *domain)
(domain->flags & IRQ_DOMAIN_FLAG_NO_MAP);
}
-static void irq_domain_clear_mapping(struct irq_domain *domain,
- irq_hw_number_t hwirq)
-{
- if (irq_domain_is_nomap(domain))
- return;
-
- if (hwirq < domain->revmap_size) {
- domain->revmap[hwirq] = NULL;
- } else {
- mutex_lock(&domain->revmap_tree_mutex);
- radix_tree_delete(&domain->revmap_tree, hwirq);
- mutex_unlock(&domain->revmap_tree_mutex);
- }
-}
-
static void irq_domain_set_mapping(struct irq_domain *domain,
irq_hw_number_t hwirq,
struct irq_data *irq_data)
@@ -529,6 +514,12 @@ static void irq_domain_set_mapping(struct irq_domain *domain,
}
}
+static void irq_domain_clear_mapping(struct irq_domain *domain,
+ irq_hw_number_t hwirq)
+{
+ irq_domain_set_mapping(domain, hwirq, NULL);
+}
+
static void irq_domain_disassociate(struct irq_domain *domain, unsigned int irq)
{
struct irq_data *irq_data = irq_get_irq_data(irq);
--
2.30.2
Powered by blists - more mailing lists