Skip to contentSkip to conversation

Staging:rtl8192e Fix Comparison to False is error prone

PATCH NAK Janani Sankara Babu 2 participants 2 messages Jun 7, 2018 – Jun 8, 2018 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 Staging:rtl8192e Fix Comparison to False is error prone

This patch removes comparison to False(ie. bool) in the code

---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +5 -5
index 3c7ba33..ccd898a 100644
@@ -258,7 +258,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
 
 	RT_TRACE(COMP_DBG, "====>rx ADDBAREQ from : %pM\n", dst);
 	if (ieee->current_network.qos_data.active == 0  ||
-	    (ieee->pHTInfo->bCurrentHTSupport == false) ||
+	    !(ieee->pHTInfo->bCurrentHTSupport) ||
 	    (ieee->pHTInfo->IOTAction & HT_IOT_ACT_REJECT_ADDBA_REQ)) {
 		rc = ADDBA_STATUS_REFUSED;
 		netdev_warn(ieee->dev,
@@ -341,8 +341,8 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
 
 	RT_TRACE(COMP_DBG, "====>rx ADDBARSP from : %pM\n", dst);
 	if (ieee->current_network.qos_data.active == 0  ||
-	    ieee->pHTInfo->bCurrentHTSupport == false ||
-	    ieee->pHTInfo->bCurrentAMPDUEnable == false) {
+	    !(ieee->pHTInfo->bCurrentHTSupport) ||
+	    !(ieee->pHTInfo->bCurrentAMPDUEnable)) {
 		netdev_warn(ieee->dev,
 			    "reject to ADDBA_RSP as some capability is not ready(%d, %d, %d)\n",
 			    ieee->current_network.qos_data.active,
@@ -369,7 +369,7 @@ int rtllib_rx_ADDBARsp(struct rtllib_device *ieee, struct sk_buff *skb)
 		netdev_dbg(ieee->dev, "%s(): ADDBA response already admitted\n",
 			   __func__);
 		return -1;
-	} else if ((pPendingBA->bValid == false) ||
+	} else if (!(pPendingBA->bValid) ||
 		   (*pDialogToken != pPendingBA->DialogToken)) {
 		netdev_warn(ieee->dev,
 			    "%s(): ADDBA Rsp. BA invalid, DELBA!\n",
@@ -432,7 +432,7 @@ int rtllib_rx_DELBA(struct rtllib_device *ieee, struct sk_buff *skb)
 	}
 
 	if (ieee->current_network.qos_data.active == 0  ||
-		ieee->pHTInfo->bCurrentHTSupport == false) {
+		!(ieee->pHTInfo->bCurrentHTSupport)) {
 		netdev_warn(ieee->dev,
 			    "received DELBA while QOS or HT is not supported(%d, %d)\n",
 			    ieee->current_network. qos_data.active,

--
1.9.1

#1 lore raw
Quoted 12 lines · Janani Sankara Babu

This patch removes comparison to False(ie. bool) in the code

---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -0
index 3c7ba33..ccd898a 100644

drivers/staging/rtl8192e/rtl819x_BAProc.c int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) · line 260

Quoted 3 lines
drivers/staging/rtl8192e/rtl819x_BAProc.c +0 -0
@@ -258,7 +258,7 @@ int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb)
 
 	RT_TRACE(COMP_DBG, "====>rx ADDBAREQ from : %pM\n", dst);
 	if (ieee->current_network.qos_data.active == 0  ||

Is .active the number of active or is it a boolean? If it's boolean then it should be changed to !ieee->current_network.qos_data.active as well.

Keep your eyes open for stuff like this when you're doing checkpatch fixes.

drivers/staging/rtl8192e/rtl819x_BAProc.c int rtllib_rx_ADDBAReq(struct rtllib_device *ieee, struct sk_buff *skb) · line 261

Quoted 2 lines
drivers/staging/rtl8192e/rtl819x_BAProc.c +1 -1
-	    (ieee->pHTInfo->bCurrentHTSupport == false) ||
+	    !(ieee->pHTInfo->bCurrentHTSupport) ||

Remove the parenthesis.

Same throughout.

regards,
dan carpenter