mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org, driver-core@lists.linux.dev,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Danilo Krummrich <dakr@kernel.org>
Subject: Re: [PATCH v1 1/1] regmap: irq: Get rid of duplicate check in regmap_del_irq_chip()
Date: Thu, 22 Oct 2026 16:16:07 +0200	[thread overview]
Message-ID: <atoap3uV702MXAjB@hovoldconsulting.com> (raw)
In-Reply-To: <atoPG1nCj9yF_eEt@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

On Thu, Oct 22, 2026 at 02:26:51PM +0100, Mark Brown wrote:
> On Thu, Oct 22, 2026 at 10:13:57AM +0200, Johan Hovold wrote:
> > On Wed, Oct 21, 2026 at 10:50:35PM +0200, Andy Shevchenko wrote:
> > > irq_dispose_mapping() already 0-aware, so there is no need to
> > > perform the same test outside of the call. Get rid of duplicate
> > > check in regmap_del_irq_chip().
> 
> > > -		virq = irq_find_mapping(d->domain, hwirq);
> > > -		if (virq)
> > > -			irq_dispose_mapping(virq);
> > > +		irq_dispose_mapping(irq_find_mapping(d->domain, hwirq));
> 
> > This just makes the code less readable, and for no good reason.
> 
> Is there intended to be a benefit from the error check?  It seems like a
> microopotimisation that just removes robustness from something that
> really should not be a hot path.

The code as it stands is easier to read and obviously correct (and
matches the preceding comment); you don't need look up the definition of
irq_dispose_mapping() and parse a ternary conditional to determine that.

Johan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]

      reply	other threads:[~2026-10-22 14:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 20:50 Andy Shevchenko
2026-10-22  8:13 ` Johan Hovold
2026-10-22 13:26   ` Mark Brown
2026-10-22 14:16     ` Johan Hovold [this message]

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=atoap3uV702MXAjB@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=dakr@kernel.org \
    --cc=driver-core@lists.linux.dev \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@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

all inboxes | Powered by JetHome®