aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/irq.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index f42e869ee3cc..4a5aa8ca97a5 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -814,8 +814,7 @@ void irq_dispose_mapping(unsigned int virq)
814 return; 814 return;
815 815
816 host = irq_map[virq].host; 816 host = irq_map[virq].host;
817 WARN_ON (host == NULL); 817 if (WARN_ON(host == NULL))
818 if (host == NULL)
819 return; 818 return;
820 819
821 /* Never unmap legacy interrupts */ 820 /* Never unmap legacy interrupts */
@@ -898,7 +897,8 @@ unsigned int irq_radix_revmap_lookup(struct irq_host *host,
898 struct irq_map_entry *ptr; 897 struct irq_map_entry *ptr;
899 unsigned int virq; 898 unsigned int virq;
900 899
901 WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE); 900 if (WARN_ON_ONCE(host->revmap_type != IRQ_HOST_MAP_TREE))
901 return irq_find_mapping(host, hwirq);
902 902
903 /* 903 /*
904 * No rcu_read_lock(ing) needed, the ptr returned can't go under us 904 * No rcu_read_lock(ing) needed, the ptr returned can't go under us
@@ -922,7 +922,8 @@ unsigned int irq_radix_revmap_lookup(struct irq_host *host,
922void irq_radix_revmap_insert(struct irq_host *host, unsigned int virq, 922void irq_radix_revmap_insert(struct irq_host *host, unsigned int virq,
923 irq_hw_number_t hwirq) 923 irq_hw_number_t hwirq)
924{ 924{
925 WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE); 925 if (WARN_ON(host->revmap_type != IRQ_HOST_MAP_TREE))
926 return;
926 927
927 if (virq != NO_IRQ) { 928 if (virq != NO_IRQ) {
928 mutex_lock(&revmap_trees_mutex); 929 mutex_lock(&revmap_trees_mutex);
@@ -937,7 +938,8 @@ unsigned int irq_linear_revmap(struct irq_host *host,
937{ 938{
938 unsigned int *revmap; 939 unsigned int *revmap;
939 940
940 WARN_ON(host->revmap_type != IRQ_HOST_MAP_LINEAR); 941 if (WARN_ON_ONCE(host->revmap_type != IRQ_HOST_MAP_LINEAR))
942 return irq_find_mapping(host, hwirq);
941 943
942 /* Check revmap bounds */ 944 /* Check revmap bounds */
943 if (unlikely(hwirq >= host->revmap_data.linear.size)) 945 if (unlikely(hwirq >= host->revmap_data.linear.size))