All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Jean Delvare <jdelvare@suse.com>,
	Guenter Roeck <linux@roeck-us.net>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Nick Desaulniers <ndesaulniers@google.com>
Subject: Clang warning in drivers/hwmon/scmi-hwmon.c
Date: Fri, 14 Sep 2018 22:10:32 -0700	[thread overview]
Message-ID: <20180915051032.GA23900@flashbox> (raw)

Hi Sundeep and others,

A group of us are trying to clean up all the warnings we see with an
'allyesconfig' arm64 build done with Clang and this one came up:

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.

Would it be appropriate to just delete that check or does the check
need to be adjusted in some way (such as checking for the first value
'sensor->name[0]')? Either option technically solves the warning but I
don't have the hardware to check if this breaks the driver.

Thanks,
Nathan

             reply	other threads:[~2018-09-15  5:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-15  5:10 Nathan Chancellor [this message]
2018-09-15 23:37 ` Clang warning in drivers/hwmon/scmi-hwmon.c Guenter Roeck
2018-09-16  0:06   ` Nathan Chancellor

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=20180915051032.GA23900@flashbox \
    --to=natechancellor@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=ndesaulniers@google.com \
    --cc=sudeep.holla@arm.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 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.