lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20190319.132634.921233603880385266.davem@davemloft.net>
Date:   Tue, 19 Mar 2019 13:26:34 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     arnd@...db.de
Cc:     jiri@...lanox.com, idosch@...lanox.com,
        yamada.masahiro@...ionext.com, vadimp@...lanox.com,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mlxsw: core: mlxsw: core: avoid -Wint-in-bool-context
 warning

From: Arnd Bergmann <arnd@...db.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@...db.de>

Applied, thanks Arnd.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ