From: Linus Walleij <linus.walleij@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Bartosz Golaszewski <brgl@bgdev.pl>
Subject: Re: [PATCH v1 2/2] gpiolib: Check array_info for NULL only once in gpiod_get_array()
Date: Thu, 23 Mar 2023 09:18:48 +0100 [thread overview]
Message-ID: <CACRpkda1fmm0uCwdUxo5bs14u50WR4C1B7XK1vmWdh5ECnaPSg@mail.gmail.com> (raw)
In-Reply-To: <20230321135412.73240-2-andriy.shevchenko@linux.intel.com>
On Tue, Mar 21, 2023 at 2:53 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
> gpiod_get_array() has a long if-else-if branching where each of them
> tests for the same variable to be not NULL. Instead, check for NULL
> before even going to that flow.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
It's way more readable like this.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
next prev parent reply other threads:[~2023-03-23 8:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 13:54 [PATCH v1 1/2] gpiolib: Replace open coded krealloc() Andy Shevchenko
2023-03-21 13:54 ` [PATCH v1 2/2] gpiolib: Check array_info for NULL only once in gpiod_get_array() Andy Shevchenko
2023-03-23 8:18 ` Linus Walleij [this message]
2023-03-23 8:17 ` [PATCH v1 1/2] gpiolib: Replace open coded krealloc() Linus Walleij
2023-03-29 16:12 ` Bartosz Golaszewski
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=CACRpkda1fmm0uCwdUxo5bs14u50WR4C1B7XK1vmWdh5ECnaPSg@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.