Thread (14 messages) 14 messages, 3 authors, 2025-05-16

Re: [PATCH v2 3/9] irqchip/gic: Convert to msi_create_parent_irq_domain() helper

From: Marc Zyngier <maz@kernel.org>
Date: 2025-05-16 10:47:09
Also in: linux-pci, lkml

On Fri, 16 May 2025 11:36:07 +0100,
Thomas Gleixner [off-list ref] wrote:
On Tue, May 13 2025 at 18:28, Marc Zyngier wrote:
quoted
 	if (!v2m)
 		return 0;
 
-	inner_domain = irq_domain_create_hierarchy(parent, 0, 0, v2m->fwnode,
-						   &gicv2m_domain_ops, v2m);
+	inner_domain = msi_create_parent_irq_domain(&(struct irq_domain_info){
+			.fwnode		= v2m->fwnode,
+			.ops		= &gicv2m_domain_ops,
+			.host_data	= v2m,
+			.parent		= parent,
+		}, &gicv2m_msi_parent_ops);
+
This really makes my eyes bleed. 

 	if (!v2m)
 		return 0;
 
-	inner_domain = irq_domain_create_hierarchy(parent, 0, 0, v2m->fwnode,
-						   &gicv2m_domain_ops, v2m);
+	struct irq_domain_info info = {
+		.fwnode		= v2m->fwnode,
+		.ops		= &gicv2m_domain_ops,
+		.host_data	= v2m,
+		.parent		= parent,
+	};
+
+	inner_domain = msi_create_parent_irq_domain(&info, &gicv2m_msi_parent_ops);

That's too readable, right?

No need to resend, I just hacked up a few lines of coccinelle script to
eliminate this offense.
I personally find the rework much uglier than the original contraption.
Variables declared in the middle of the code, Rust-style? Meh.

But hey, your call.

	M.

-- 
Without deviation from the norm, progress is not possible.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help