LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] iwlwifi: mvm: Fix bitwise vs logical operator in iwl_mvm_scan_fits()
@ 2021-08-14 23:42 Nathan Chancellor
2021-08-16 18:45 ` Nick Desaulniers
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2021-08-14 23:42 UTC (permalink / raw)
To: Luca Coelho
Cc: Kalle Valo, Nick Desaulniers, linux-wireless, netdev,
linux-kernel, clang-built-linux, Nathan Chancellor
Clang warns:
drivers/net/wireless/intel/iwlwifi/mvm/scan.c:835:3: warning: bitwise
and of boolean expressions; did you mean logical and?
[-Wbool-operation-and]
(n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&&
1 warning generated.
Replace the bitwise AND with a logical one to solve the warning, which
is clearly what was intended.
Fixes: 999d2568ee0c ("iwlwifi: mvm: combine scan size checks into a common function")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
index 0368b7101222..494379fc9224 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
@@ -832,7 +832,7 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
int n_channels)
{
return ((n_ssids <= PROBE_OPTION_MAX) &&
- (n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
+ (n_channels <= mvm->fw->ucode_capa.n_scan_channels) &&
(ies->common_ie_len +
ies->len[NL80211_BAND_2GHZ] +
ies->len[NL80211_BAND_5GHZ] <=
base-commit: ba31f97d43be41ca99ab72a6131d7c226306865f
--
2.33.0.rc2
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iwlwifi: mvm: Fix bitwise vs logical operator in iwl_mvm_scan_fits()
2021-08-14 23:42 [PATCH] iwlwifi: mvm: Fix bitwise vs logical operator in iwl_mvm_scan_fits() Nathan Chancellor
@ 2021-08-16 18:45 ` Nick Desaulniers
0 siblings, 0 replies; 2+ messages in thread
From: Nick Desaulniers @ 2021-08-16 18:45 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Luca Coelho, Kalle Valo, linux-wireless, netdev, linux-kernel,
clang-built-linux
On Sat, Aug 14, 2021 at 4:43 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> Clang warns:
>
> drivers/net/wireless/intel/iwlwifi/mvm/scan.c:835:3: warning: bitwise
> and of boolean expressions; did you mean logical and?
> [-Wbool-operation-and]
> (n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> &&
> 1 warning generated.
>
> Replace the bitwise AND with a logical one to solve the warning, which
> is clearly what was intended.
>
> Fixes: 999d2568ee0c ("iwlwifi: mvm: combine scan size checks into a common function")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
> drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
> index 0368b7101222..494379fc9224 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/scan.c
> @@ -832,7 +832,7 @@ static inline bool iwl_mvm_scan_fits(struct iwl_mvm *mvm, int n_ssids,
> int n_channels)
> {
> return ((n_ssids <= PROBE_OPTION_MAX) &&
> - (n_channels <= mvm->fw->ucode_capa.n_scan_channels) &
> + (n_channels <= mvm->fw->ucode_capa.n_scan_channels) &&
> (ies->common_ie_len +
> ies->len[NL80211_BAND_2GHZ] +
> ies->len[NL80211_BAND_5GHZ] <=
>
> base-commit: ba31f97d43be41ca99ab72a6131d7c226306865f
> --
> 2.33.0.rc2
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-16 18:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14 23:42 [PATCH] iwlwifi: mvm: Fix bitwise vs logical operator in iwl_mvm_scan_fits() Nathan Chancellor
2021-08-16 18:45 ` Nick Desaulniers
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).