From: Guenter Roeck <linux@roeck-us.net>
To: Nathan Chancellor <natechancellor@gmail.com>,
Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>
Subject: Re: [PATCH] hwmon: scmi: Remove redundant pointer check
Date: Sat, 15 Sep 2018 17:44:25 -0700 [thread overview]
Message-ID: <568ec241-baf8-7ccd-c0e3-7724a5eb90ae@roeck-us.net> (raw)
In-Reply-To: <20180916000506.28905-1-natechancellor@gmail.com>
On 09/15/2018 05:05 PM, Nathan Chancellor wrote:
> Clang warns when the address of a pointer is used in a boolean context
> as it will always return true.
>
> drivers/hwmon/scmi-hwmon.c:59:24: warning: address of array
> 'sensor->name' will always evaluate to 'true'
> [-Wpointer-bool-conversion]
> if (sensor && sensor->name)
> ~~ ~~~~~~~~^~~~
> 1 warning generated.
>
> Remove the check as it isn't doing anything currently; if validation
> of the contents of the data structure was intended by the original
> author (since this line has been present from the first version of
> this driver), it can be added in a follow-up patch.
>
> Reported-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Applied to hwmon-next.
Thanks,
Guenter
prev parent reply other threads:[~2018-09-16 6:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-16 0:05 [PATCH] hwmon: scmi: Remove redundant pointer check Nathan Chancellor
2018-09-16 0:44 ` Guenter Roeck [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=568ec241-baf8-7ccd-c0e3-7724a5eb90ae@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.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