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.