LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/4] Staging:rtl8192e Fix Comparison to False is error prone
@ 2018-06-08  4:33 Janani Sankara Babu
  2018-06-08 11:05 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Janani Sankara Babu @ 2018-06-08  4:33 UTC (permalink / raw)
  To: gregkh
  Cc: johannes.berg, davem, keescook, Rene.Hickersberger, devel,
	linux-kernel, Janani Sankara Babu

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

Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
---
 drivers/staging/rtl8192e/rtl819x_BAProc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
index 3c7ba33..ccd898a 100644
--- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
@@ -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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 2/4] Staging:rtl8192e Fix Comparison to False is error prone
  2018-06-08  4:33 [PATCH 2/4] Staging:rtl8192e Fix Comparison to False is error prone Janani Sankara Babu
@ 2018-06-08 11:05 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2018-06-08 11:05 UTC (permalink / raw)
  To: Janani Sankara Babu
  Cc: gregkh, devel, keescook, johannes.berg, linux-kernel,
	Rene.Hickersberger, davem

On Fri, Jun 08, 2018 at 12:33:56AM -0400, Janani Sankara Babu wrote:
> This patch removes comparison to False(ie. bool) in the code
> 
> Signed-off-by: Janani Sankara Babu <jananis37@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl819x_BAProc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c
> index 3c7ba33..ccd898a 100644
> --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c
> +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c
> @@ -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.

> -	    (ieee->pHTInfo->bCurrentHTSupport == false) ||
> +	    !(ieee->pHTInfo->bCurrentHTSupport) ||

Remove the parenthesis.

Same throughout.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-06-08 11:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-08  4:33 [PATCH 2/4] Staging:rtl8192e Fix Comparison to False is error prone Janani Sankara Babu
2018-06-08 11:05 ` Dan Carpenter

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).