From: Johannes Berg <johannes@sipsolutions.net>
To: Matthias Kaehlcke <mka@chromium.org>,
"David S . Miller" <davem@davemloft.net>
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
netdev@vger.kernel.org, Grant Grundler <grundler@chromium.org>,
Michael Davidson <md@google.com>,
Greg Hackmann <ghackmann@google.com>
Subject: Re: [PATCH v2] mac80211: Fix clang warning about constant operand in logical operation
Date: Thu, 13 Apr 2017 08:27:30 +0200 [thread overview]
Message-ID: <1492064850.19193.6.camel@sipsolutions.net> (raw)
In-Reply-To: <20170406233141.123098-1-mka@chromium.org> (sfid-20170407_013202_907352_DB786B38)
On Thu, 2017-04-06 at 16:31 -0700, Matthias Kaehlcke wrote:
> When clang detects a non-boolean constant in a logical operation it
> generates a 'constant-logical-operand' warning. In
> ieee80211_try_rate_control_ops_get() the result of strlen(<const
> str>)
> is used in a logical operation, clang resolves the expression to an
> (integer) constant at compile time when clang's builtin strlen
> function
> is used.
>
> Change the condition to check for strlen() > 0 to make the constant
> operand boolean and thus avoid the warning.
>
Applied.
johannes
prev parent reply other threads:[~2017-04-13 6:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-06 23:31 [PATCH v2] mac80211: Fix clang warning about constant operand in logical operation Matthias Kaehlcke
2017-04-13 6:27 ` Johannes Berg [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=1492064850.19193.6.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=davem@davemloft.net \
--cc=ghackmann@google.com \
--cc=grundler@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=md@google.com \
--cc=mka@chromium.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).