Commit 5ba1a1da authored by Puranjay Mohan's avatar Puranjay Mohan Committed by Greg Kroah-Hartman

Staging: rtl8192u: ieee80211: Use !x in place of NULL comparison

Fix comparison to NULL, chang to !x operation.
Issue found using checkpatch.pl
Signed-off-by: default avatarPuranjay Mohan <puranjay12@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c61ec9e6
...@@ -1796,7 +1796,7 @@ static void ieee80211_process_action(struct ieee80211_device *ieee, ...@@ -1796,7 +1796,7 @@ static void ieee80211_process_action(struct ieee80211_device *ieee,
u8 *act = ieee80211_get_payload(header); u8 *act = ieee80211_get_payload(header);
u8 tmp = 0; u8 tmp = 0;
// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len);
if (act == NULL) { if (!act) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of action frame\n"); IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of action frame\n");
return; return;
} }
...@@ -1929,7 +1929,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1929,7 +1929,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb,
memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, network->bssht.bdHTCapLen); memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, network->bssht.bdHTCapLen);
memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen); memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen);
} }
if (ieee->handle_assoc_response != NULL) if (ieee->handle_assoc_response)
ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame *)header, network); ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame *)header, network);
} }
ieee80211_associate_complete(ieee); ieee80211_associate_complete(ieee);
...@@ -2856,7 +2856,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ...@@ -2856,7 +2856,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
goto done; goto done;
} }
if (*crypt == NULL || (*crypt)->ops != ops) { if (!*crypt || (*crypt)->ops != ops) {
struct ieee80211_crypt_data *new_crypt; struct ieee80211_crypt_data *new_crypt;
ieee80211_crypt_delayed_deinit(ieee, crypt); ieee80211_crypt_delayed_deinit(ieee, crypt);
...@@ -2871,7 +2871,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ...@@ -2871,7 +2871,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
new_crypt->priv = new_crypt->priv =
new_crypt->ops->init(param->u.crypt.idx); new_crypt->ops->init(param->u.crypt.idx);
if (new_crypt->priv == NULL) { if (!new_crypt->priv) {
kfree(new_crypt); kfree(new_crypt);
param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED; param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED;
ret = -EINVAL; ret = -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment