public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tglx <tglx@linutronix.de>
To: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: maz@kernel.org, linux-kernel@vger.kernel.org,
	"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Subject: Re: [PATCH 09/18] irqdomain: Rename _add functions to _add_*_of_node
Date: Thu, 06 Feb 2025 17:22:38 +0100	[thread overview]
Message-ID: <87wme3m4a9.ffs@tglx> (raw)
In-Reply-To: <20250115085409.1629787-10-jirislaby@kernel.org>

Jiri!

On Wed, Jan 15 2025 at 09:53, Jiri Slaby (SUSE) wrote:
> For readers, it is very confusing that:
> * irq_domain_add_*() functions are dedicated to of_nodes,
> * irq_domain_create_*() ones to fwnodes, and
> * irq_domain_instantiate() to the universal struct irq_domain_info.
>
> Neither _create, nor _add designate any of those nodes. Despite the
> naming, the functionality of them is the same: add an irq domain (by
> generic irq_domain_instantiate()). So the source of the confusion is the
> naming proper -- making the distinction based on _create, _add, and
> _instantiate.
>
> Therefore, here an "_of_node" suffix is added to all "_add" functions
> (of_node ones). In the next patch, "_create" (fwnode ones) are switched
> to "_add_fwnode". And finally, "_instantiate" is renamed to "_add".
>
> So when all are applied, the interface is much easier to follow:
> * dom = irq_domain_add_linear_of_node(of_node, ...)
> * dom = irq_domain_add_linear_fwnode(fwnode, ...)
> * dom = irq_domain_add(info)
> * irq_domain_remove(dom)

I'm not convinced that this _of_node() _fwnode() churn is actually
valuable. I rather go and consolidate the code so that the core
functions take a fwnode argument, i.e.

   - irq_domain_add_xxx(node, ...)
   + irq_domain_add_xxx(of_fwnode_handle(node), ....)

It's not asked too much from the developer to use of_fwnode_handle() at
the call site and the resulting treewide churn is pretty much the same
as in any case all call sites need to be touched.

But that brings me to the question of logistics for this overhaul. As
this is a treewide change, there is quite some potential to create
conflicts all over the place.

So the obvious solution is to consolidate on the existing
irq_domain_create_*() API, which is not the worst naming once everything
is unified, i.e. 

   - irq_domain_add_xxx(node, ...)
   + irq_domain_create_xxx(of_fwnode_handle(node), ....)

It allows to distribute these changes (except for the _nomap() oddity,
which is OF only) right now to the relevant subsystems and I can collect
the ignored changes in the irq tree. The final removal of the _add*()
interfaces can then be done towards the end of the merge window.

Thoughts?

Thanks,

        tglx





  reply	other threads:[~2025-02-06 16:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15  8:53 [PATCH 00/18] irqdomain: couple cleanups and documentation Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 01/18] irqdomain.h: Remove extern from function declarations Jiri Slaby (SUSE)
2025-03-10  9:06   ` [tip: irq/core] irqdomain: " tip-bot2 for Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 02/18] irqdomain: Rename irq_set_default_host() to irq_set_default_domain() Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 03/18] irqdomain: Rename irq_get_default_host() to irq_get_default_domain() Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 04/18] irqdomain.h: Stop using 'host' for domain Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 05/18] irqdomain: Drop of_node_to_fwnode() Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 06/18] irqdomain: Make a couple of functions an inline Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 07/18] irqdomain: Make irq_domain_instantiate() returned domains an initializer Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 08/18] irqdomain: Make struct irq_domain_info variables const Jiri Slaby (SUSE)
2025-01-15  8:53 ` [PATCH 09/18] irqdomain: Rename _add functions to _add_*_of_node Jiri Slaby (SUSE)
2025-02-06 16:22   ` tglx [this message]
2025-02-20  8:17     ` Jiri Slaby
2025-02-20 14:23       ` Thomas Gleixner
2025-01-15  8:53 ` [PATCH 10/18] irqdomain: Rename _create functions to _add_*_fwnode Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 11/18] irqdomain: Rename _instantiate functions to _add Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 12/18] irqdomain: Switch away from irq_linear_revmap() and drop it Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 13/18] irqdomain.h: Improve kernel-docs of functions Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 14/18] docs: irq/concepts: Add commas and reflow Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 15/18] docs: irq/concepts: Minor improvements Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 16/18] docs: irq-domain.rst: Simple improvements Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 17/18] docs: irqdomain: Update Jiri Slaby (SUSE)
2025-01-15  8:54 ` [PATCH 18/18] irqdomain.c: Fix kernel-doc and add it to Documentation Jiri Slaby (SUSE)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wme3m4a9.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox