From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: [PATCH v4 2/2] gpiolib: Fold conditionals into simple ternary operator
Date: Mon, 8 Mar 2021 21:46:52 +0200 [thread overview]
Message-ID: <YEZ/LFwFkh3+zyjY@smile.fi.intel.com> (raw)
In-Reply-To: <CAJZ5v0gpNzyBDKfBXoBYskUXs15GrZAe-E2vzhSEu2Nrj7wa7g@mail.gmail.com>
On Mon, Mar 08, 2021 at 08:43:19PM +0100, Rafael J. Wysocki wrote:
> On Mon, Mar 8, 2021 at 8:33 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
...
> It looks like the ops local var is redundant.
>
> > unsigned int type;
> > unsigned int i;
> >
> > @@ -1496,11 +1496,7 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc,
> > return ret;
> > } else {
> > /* Some drivers provide custom irqdomain ops */
> > - if (gc->irq.domain_ops)
> > - ops = gc->irq.domain_ops;
> > -
> > - if (!ops)
> > - ops = &gpiochip_domain_ops;
> > + ops = gc->irq.domain_ops ?: &gpiochip_domain_ops;
> > gc->irq.domain = irq_domain_create_simple(fwnode,
> > gc->ngpio,
> > gc->irq.first,
>
> Because this can be
>
> gc->irq.domain = irq_domain_add_simple(np,
> gc->ngpio,
> gc->irq.first,
> gc->irq.domain_ops ?: &gpiochip_domain_ops,
> gc);
>
> (modulo white space / formatting) and this is the only place where ops
> is used in this function.
I just sent v5 without this, sorry :-)
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-03-08 19:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 19:31 [PATCH v4 1/2] gpiolib: Reuse device's fwnode to create IRQ domain Andy Shevchenko
2021-03-08 19:31 ` [PATCH v4 2/2] gpiolib: Fold conditionals into simple ternary operator Andy Shevchenko
2021-03-08 19:43 ` Rafael J. Wysocki
2021-03-08 19:46 ` Andy Shevchenko [this message]
2021-03-08 19:52 ` Andy Shevchenko
2021-03-08 19:36 ` [PATCH v4 1/2] gpiolib: Reuse device's fwnode to create IRQ domain Rafael J. Wysocki
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=YEZ/LFwFkh3+zyjY@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=bgolaszewski@baylibre.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for NNTP newsgroup(s).