public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Jiri Pirko <jiri@mellanox.com>,
	Ido Schimmel <idosch@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Vadim Pasternak <vadimp@mellanox.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mlxsw: core: mlxsw: core: avoid -Wint-in-bool-context warning
Date: Mon, 18 Mar 2019 21:05:19 +0100	[thread overview]
Message-ID: <20190318200519.GN2270@nanopsycho> (raw)
In-Reply-To: <20190318163536.2171073-1-arnd@arndb.de>

Mon, Mar 18, 2019 at 05:35:11PM CET, arnd@arndb.de wrote:
>A recently added function in mlxsw triggers a harmless compiler warning:
>
>In file included from drivers/net/ethernet/mellanox/mlxsw/core.h:17,
>                 from drivers/net/ethernet/mellanox/mlxsw/core_env.c:7:
>drivers/net/ethernet/mellanox/mlxsw/core_env.c: In function 'mlxsw_env_module_temp_thresholds_get':
>drivers/net/ethernet/mellanox/mlxsw/reg.h:8015:45: error: '*' in boolean context, suggest '&&' instead [-Werror=int-in-bool-context]
> #define MLXSW_REG_MTMP_TEMP_TO_MC(val) (val * 125)
>                                        ~~~~~^~~~~~
>drivers/net/ethernet/mellanox/mlxsw/core_env.c:116:8: note: in expansion of macro 'MLXSW_REG_MTMP_TEMP_TO_MC'
>   if (!MLXSW_REG_MTMP_TEMP_TO_MC(module_temp)) {
>        ^~~~~~~~~~~~~~~~~~~~~~~~~
>
>The warning is normally disabled, but it would be nice to enable
>it to find real bugs, and there are no other known instances at
>the moment.
>
>Replace the negation with a zero-comparison, which also matches
>the comment above it.
>
>Fixes: d93c19a1d95c ("mlxsw: core: Add API for QSFP module temperature thresholds reading")
>Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Jiri Pirko <jiri@mellanox.com>

  reply	other threads:[~2019-03-18 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 16:35 [PATCH] mlxsw: core: mlxsw: core: avoid -Wint-in-bool-context warning Arnd Bergmann
2019-03-18 20:05 ` Jiri Pirko [this message]
2019-03-19 20:26 ` David Miller

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=20190318200519.GN2270@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vadimp@mellanox.com \
    --cc=yamada.masahiro@socionext.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