Skip to contentSkip to conversation

rsi: Remove unnecessary boolean condition

PATCH In review Nathan Chancellor 2 participants 2 messages Sep 21, 2018 – Oct 1, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rsi: Remove unnecessary boolean condition

Clang warns that the address of a pointer will always evaluated as true in a boolean context.

drivers/net/wireless/rsi/rsi_91x_mac80211.c:927:50: warning: address of array 'key->key' will always evaluate to 'true' [-Wpointer-bool-conversion]

        if (vif->type == NL80211_IFTYPE_STATION && key->key &&
                                                ~~ ~~~~~^~~

1 warning generated.

---
 drivers/net/wireless/rsi/rsi_91x_mac80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/rsi/rsi_91x_mac80211.c +1 -1
index 4e510cbe0a89..e56fc83faf0e 100644
@@ -924,7 +924,7 @@ static int rsi_hal_key_config(struct ieee80211_hw *hw,
 	if (status)
 		return status;
 
-	if (vif->type == NL80211_IFTYPE_STATION && key->key &&
+	if (vif->type == NL80211_IFTYPE_STATION &&
 	    (key->cipher == WLAN_CIPHER_SUITE_WEP104 ||
 	     key->cipher == WLAN_CIPHER_SUITE_WEP40)) {
 		if (!rsi_send_block_unblock_frame(adapter->priv, false))
Signature · 1 line
2.19.0
#1 lore raw
Quoted 6 lines · Nathan Chancellor

Clang warns that the address of a pointer will always evaluated as true in a boolean context.

drivers/net/wireless/rsi/rsi_91x_mac80211.c:927:50: warning: address of array 'key->key' will always evaluate to 'true' [-Wpointer-bool-conversion]

Quoted 6 lines
        if (vif->type == NL80211_IFTYPE_STATION && key->key &&
                                                ~~ ~~~~~^~~

1 warning generated.

Patch applied to wireless-drivers-next.git, thanks.

f613e4803dd6 rsi: Remove unnecessary boolean condition

Signature · 3 lines
https://patchwork.kernel.org/patch/10609513/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches