From: Mark Brown <broonie@kernel.org>
To: Colin King <colin.king@canonical.com>
Cc: Support Opensource <support.opensource@diasemi.com>,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regulator: da9052: remove null pointer check on array pdata->regulators
Date: Tue, 13 Sep 2016 00:51:42 +0100 [thread overview]
Message-ID: <20160912235142.GN27946@sirena.org.uk> (raw)
In-Reply-To: <20160908100736.19046-1-colin.king@canonical.com>
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
On Thu, Sep 08, 2016 at 11:07:36AM +0100, Colin King wrote:
> pdata->regulators is an array of DA9052_MAX_REGULATORS struct
> regulator_init_data pointers hence cannot be null, so the null pointer
> check on pdata->regulators is redundant. Remove it.
> - if (pdata && pdata->regulators) {
> + if (pdata) {
What is the benefit of this change? Due to the way C handles arrays and
pointers one can't immediately tell without opening up the header file
if regulators is a pointer to an array or an embedded array so it's more
work to read and since this is the probe path it's unlikely to be a
meaningful speed improvement even if the compiler doesn't figure it out
at build time.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
prev parent reply other threads:[~2016-09-12 23:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-08 10:07 Colin King
2016-09-12 23:51 ` Mark Brown [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=20160912235142.GN27946@sirena.org.uk \
--to=broonie@kernel.org \
--cc=colin.king@canonical.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=support.opensource@diasemi.com \
/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®