diff options
author | Nathan Chancellor <natechancellor@gmail.com> | 2018-09-16 03:05:07 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-06-09 11:24:03 +0300 |
commit | 707aec6198e99bbacde15f329c8c460a7b427e7b (patch) | |
tree | 357c82e06af3e2a5ebfe867de47e1205cc16e908 /drivers/hwmon | |
parent | f522bff5f4d4b5256f6af2db10e7d3e0351544ae (diff) | |
download | linux-707aec6198e99bbacde15f329c8c460a7b427e7b.tar.xz |
hwmon: (scmi) Remove redundant pointer check
commit a31796c30e423f58d266df30a9bbf321fc071b30 upstream.
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>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/scmi-hwmon.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c index 91bfecdb3f5b..84880c0ff7ab 100644 --- a/drivers/hwmon/scmi-hwmon.c +++ b/drivers/hwmon/scmi-hwmon.c @@ -56,7 +56,7 @@ scmi_hwmon_is_visible(const void *drvdata, enum hwmon_sensor_types type, const struct scmi_sensors *scmi_sensors = drvdata; sensor = *(scmi_sensors->info[type] + channel); - if (sensor && sensor->name) + if (sensor) return S_IRUGO; return 0; |