mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: arnd@arndb.de
Cc: jiri@mellanox.com, idosch@mellanox.com,
	yamada.masahiro@socionext.com, 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: Tue, 19 Mar 2019 13:26:34 -0700 (PDT)	[thread overview]
Message-ID: <20190319.132634.921233603880385266.davem@davemloft.net> (raw)
In-Reply-To: <20190318163536.2171073-1-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 18 Mar 2019 17:35:11 +0100

> 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>

Applied, thanks Arnd.

      parent reply	other threads:[~2019-03-19 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 16:35 Arnd Bergmann
2019-03-18 20:05 ` Jiri Pirko
2019-03-19 20:26 ` David Miller [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=20190319.132634.921233603880385266.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=arnd@arndb.de \
    --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

all inboxes | Powered by JetHome®