Skip to contentSkip to conversation

[Patch irqdomain: Enhance irq_domain_free_irqs_common() to support parentless irqdomain

PATCH Jiang Liu 2 participants 4 messages Nov 21, 2014 – Nov 23, 2014

Subsystems (3)
lore
Share & tools
lore

Jiang Liu

author
#0 lore raw

Originally irq_domain_free_irqs_common() is designed to be used by irqdomains with parent. But there are desires to reuse for parentless irqdomains for code reduction.
So check domain->parent before invoking irq_domain_free_irqs_parent().

---
Hi Thomas,
This patch applies to tip/irq/irqdomain, it helps to reduce code
size on ARM. Seems we still have chance to merge it into tip/irq/irqdomain:) Regards!
Gerry

---
 kernel/irq/irqdomain.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/irqdomain.c +2 -1
index 029acf11efed..0449d2869e17 100644
@@ -975,7 +975,8 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq,
 		if (irq_data)
 			irq_domain_reset_irq_data(irq_data);
 	}
-	irq_domain_free_irqs_parent(domain, virq, nr_irqs);
+	if (domain->parent)
+		irq_domain_free_irqs_parent(domain, virq, nr_irqs);
 }
 
 /**
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 21 lines · Jiang Liu

Originally irq_domain_free_irqs_common() is designed to be used by irqdomains with parent. But there are desires to reuse for parentless irqdomains for code reduction.
So check domain->parent before invoking irq_domain_free_irqs_parent().

---
Hi Thomas,
This patch applies to tip/irq/irqdomain, it helps to reduce code
size on ARM. Seems we still have chance to merge it into tip/irq/irqdomain:) Regards!
Gerry

---
 kernel/irq/irqdomain.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/irqdomain.c +0 -0
index 029acf11efed..0449d2869e17 100644

kernel/irq/irqdomain.c void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq, · line 979

Quoted 6 lines
kernel/irq/irqdomain.c +2 -1
@@ -975,7 +975,8 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq,
 		if (irq_data)
 			irq_domain_reset_irq_data(irq_data);
 	}
-	irq_domain_free_irqs_parent(domain, virq, nr_irqs);
+	if (domain->parent)
+		irq_domain_free_irqs_parent(domain, virq, nr_irqs);

irq_domain_free_irqs_parent()

{
	if (domain->parent && domain->parent->ops->free)
	   	...
}

So the above is redundant and does not change anything.

Thanks,

tglx

#2 lore raw
Quoted 31 lines · Thomas Gleixner
Quoted 21 lines · Jiang Liu

Originally irq_domain_free_irqs_common() is designed to be used by irqdomains with parent. But there are desires to reuse for parentless irqdomains for code reduction.
So check domain->parent before invoking irq_domain_free_irqs_parent().

---
Hi Thomas,
This patch applies to tip/irq/irqdomain, it helps to reduce code
size on ARM. Seems we still have chance to merge it into tip/irq/irqdomain:) Regards!
Gerry

---
 kernel/irq/irqdomain.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/irqdomain.c +0 -0
index 029acf11efed..0449d2869e17 100644

kernel/irq/irqdomain.c void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq, · line 979

Quoted 6 lines
kernel/irq/irqdomain.c +2 -1
@@ -975,7 +975,8 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq,
 		if (irq_data)
 			irq_domain_reset_irq_data(irq_data);
 	}
-	irq_domain_free_irqs_parent(domain, virq, nr_irqs);
+	if (domain->parent)
+		irq_domain_free_irqs_parent(domain, virq, nr_irqs);

irq_domain_free_irqs_parent()

Quoted 6 lines
{
	if (domain->parent && domain->parent->ops->free)
	   	...
}

So the above is redundant and does not change anything.

Except that this function gets replaced later in the series and drops the parent check.

Though we should not put the conditionals on the call sites. We want the functions handle it.

/me goes fixing.

Thanks,

tglx

author
#3 lore raw
Quoted 40 lines · Thomas Gleixner
Quoted 31 lines · Thomas Gleixner
Quoted 21 lines · Jiang Liu

Originally irq_domain_free_irqs_common() is designed to be used by irqdomains with parent. But there are desires to reuse for parentless irqdomains for code reduction.
So check domain->parent before invoking irq_domain_free_irqs_parent().

---
Hi Thomas,
This patch applies to tip/irq/irqdomain, it helps to reduce code
size on ARM. Seems we still have chance to merge it into tip/irq/irqdomain:) Regards!
Gerry

---
 kernel/irq/irqdomain.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/irq/irqdomain.c +0 -0
index 029acf11efed..0449d2869e17 100644

kernel/irq/irqdomain.c void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq, · line 979

Quoted 6 lines
kernel/irq/irqdomain.c +2 -1
@@ -975,7 +975,8 @@ void irq_domain_free_irqs_common(struct irq_domain *domain, unsigned int virq,
 		if (irq_data)
 			irq_domain_reset_irq_data(irq_data);
 	}
-	irq_domain_free_irqs_parent(domain, virq, nr_irqs);
+	if (domain->parent)
+		irq_domain_free_irqs_parent(domain, virq, nr_irqs);

irq_domain_free_irqs_parent()

Quoted 6 lines
{
	if (domain->parent && domain->parent->ops->free)
	   	...
}

So the above is redundant and does not change anything.

Quoted 7 lines

Except that this function gets replaced later in the series and drops the parent check.

Though we should not put the conditionals on the call sites. We want the functions handle it.

/me goes fixing.

Thanks, Thomas!

Quoted 5 lines

Thanks,

tglx