[PATCH v2] staging:rtl8723au: core: Fix error reported by checkpatch.

2014-11-05 Thread Sanjeev Sharma
This is a patch to the rtw_cmd.c file that fixes
Error reported by checkpatch.

Signed-off-by: Sanjeev Sharma sanjeev_sha...@mentor.com
---
Changes in v2:
  - Shorten variable name by taking temporary structure 

 drivers/staging/rtl8723au/core/rtw_cmd.c | 126 +++
 1 file changed, 62 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_cmd.c 
b/drivers/staging/rtl8723au/core/rtw_cmd.c
index 4eaa502..c6f6030 100644
--- a/drivers/staging/rtl8723au/core/rtw_cmd.c
+++ b/drivers/staging/rtl8723au/core/rtw_cmd.c
@@ -919,34 +919,34 @@ static void traffic_status_watchdog(struct rtw_adapter 
*padapter)
u8 bHigherBusyTxTraffic = false;
struct mlme_priv *pmlmepriv = padapter-mlmepriv;
int BusyThreshold = 100;
+   struct rt_link_detect *ldi = pmlmepriv-LinkDetectInfo;
+
/*  */
/*  Determine if our traffic is busy now */
/*  */
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
if (rtl8723a_BT_coexist(padapter))
BusyThreshold = 50;
-   else if (pmlmepriv-LinkDetectInfo.bBusyTraffic)
+   else if (ldi-bBusyTraffic)
BusyThreshold = 75;
/*  if we raise bBusyTraffic in last watchdog, using
lower threshold. */
-   if (pmlmepriv-LinkDetectInfo.NumRxOkInPeriod  BusyThreshold ||
-   pmlmepriv-LinkDetectInfo.NumTxOkInPeriod  BusyThreshold) {
+   if (ldi-NumRxOkInPeriod  BusyThreshold ||
+   ldi-NumTxOkInPeriod  BusyThreshold) {
bBusyTraffic = true;
 
-   if (pmlmepriv-LinkDetectInfo.NumRxOkInPeriod 
-   pmlmepriv-LinkDetectInfo.NumTxOkInPeriod)
+   if (ldi-NumRxOkInPeriod  ldi-NumTxOkInPeriod)
bRxBusyTraffic = true;
else
bTxBusyTraffic = true;
}
 
/*  Higher Tx/Rx data. */
-   if (pmlmepriv-LinkDetectInfo.NumRxOkInPeriod  4000 ||
-   pmlmepriv-LinkDetectInfo.NumTxOkInPeriod  4000) {
+   if (ldi-NumRxOkInPeriod  4000 ||
+   ldi-NumTxOkInPeriod  4000) {
bHigherBusyTraffic = true;
 
-   if (pmlmepriv-LinkDetectInfo.NumRxOkInPeriod 
-   pmlmepriv-LinkDetectInfo.NumTxOkInPeriod)
+   if (ldi-NumRxOkInPeriod  ldi-NumTxOkInPeriod)
bHigherBusyRxTraffic = true;
else
bHigherBusyTxTraffic = true;
@@ -955,9 +955,9 @@ static void traffic_status_watchdog(struct rtw_adapter 
*padapter)
if (!rtl8723a_BT_coexist(padapter) ||
!rtl8723a_BT_using_antenna_1(padapter)) {
/*  check traffic for  powersaving. */
-   if (((pmlmepriv-LinkDetectInfo.NumRxUnicastOkInPeriod +
- pmlmepriv-LinkDetectInfo.NumTxOkInPeriod)  8) ||
-   pmlmepriv-LinkDetectInfo.NumRxUnicastOkInPeriod 2)
+   if (((ldi-NumRxUnicastOkInPeriod +
+ ldi-NumTxOkInPeriod)  8) ||
+   ldi-NumRxUnicastOkInPeriod  2)
bEnterPS = false;
else
bEnterPS = true;
@@ -968,18 +968,19 @@ static void traffic_status_watchdog(struct rtw_adapter 
*padapter)
else
LPS_Leave23a(padapter);
}
-   } else
+   } else {
LPS_Leave23a(padapter);
+   }
 
-   pmlmepriv-LinkDetectInfo.NumRxOkInPeriod = 0;
-   pmlmepriv-LinkDetectInfo.NumTxOkInPeriod = 0;
-   pmlmepriv-LinkDetectInfo.NumRxUnicastOkInPeriod = 0;
-   pmlmepriv-LinkDetectInfo.bBusyTraffic = bBusyTraffic;
-   pmlmepriv-LinkDetectInfo.bTxBusyTraffic = bTxBusyTraffic;
-   pmlmepriv-LinkDetectInfo.bRxBusyTraffic = bRxBusyTraffic;
-   pmlmepriv-LinkDetectInfo.bHigherBusyTraffic = bHigherBusyTraffic;
-   pmlmepriv-LinkDetectInfo.bHigherBusyRxTraffic = bHigherBusyRxTraffic;
-   pmlmepriv-LinkDetectInfo.bHigherBusyTxTraffic = bHigherBusyTxTraffic;
+   ldi-NumRxOkInPeriod = 0;
+   ldi-NumTxOkInPeriod = 0;
+   ldi-NumRxUnicastOkInPeriod = 0;
+   ldi-bBusyTraffic = bBusyTraffic;
+   ldi-bTxBusyTraffic = bTxBusyTraffic;
+   ldi-bRxBusyTraffic = bRxBusyTraffic;
+   ldi-bHigherBusyTraffic = bHigherBusyTraffic;
+   ldi-bHigherBusyRxTraffic = bHigherBusyRxTraffic;
+   ldi-bHigherBusyTxTraffic = bHigherBusyTxTraffic;
 }
 
 static void dynamic_chk_wk_hdl(struct rtw_adapter *padapter, u8 *pbuf, int sz)
@@ -1017,46 +1018,44 @@ static void lps_ctrl_wk_hdl(struct rtw_adapter 
*padapter, u8 lps_ctrl_type)
   

Re: [PATCH v2] staging:rtl8723au: core: Fix error reported by checkpatch.

2014-11-05 Thread Greg KH
On Wed, Nov 05, 2014 at 05:05:03PM +0530, Sanjeev Sharma wrote:
 This is a patch to the rtw_cmd.c file that fixes
 Error reported by checkpatch.

What error are you fixing?  Please be specific.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging:rtl8723au: core: Fix error reported by checkpatch.

2014-11-05 Thread Joe Perches
On Wed, 2014-11-05 at 17:05 +0530, Sanjeev Sharma wrote:
 This is a patch to the rtw_cmd.c file that fixes
 Error reported by checkpatch.

Please run your patches through checkpatch before
sending them.

WARNING: suspect code indent for conditional statements (24, 24)
#178: FILE: drivers/staging/rtl8723au/core/rtw_cmd.c:1025:
+   if (check_fwstate(pmlmepriv, _FW_LINKED))
LPS_Leave23a(padapter);

Also, there are a couple of different things
you changing here.

This should be 2 separate patches.

One to use the temporary for:
+   struct rt_link_detect *ldi = pmlmepriv-LinkDetectInfo;

(and that bit has a defect here:


+   } else {
LPS_Leave23a(padapter);
+   }

where the indentation for the last close brace is wrong)

and another for the whitespace only changes


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v2] staging:rtl8723au: core: Fix error reported by checkpatch.

2014-11-05 Thread Sharma, Sanjeev
-Original Message-
From: Joe Perches [mailto:j...@perches.com] 
Sent: Wednesday, November 05, 2014 10:46 PM
To: Sharma, Sanjeev
Cc: larry.fin...@lwfinger.net; jes.soren...@redhat.com; 
gre...@linuxfoundation.org; linux-wirel...@vger.kernel.org; 
de...@driverdev.osuosl.org; linux-ker...@vger.kernel.org
Subject: Re: [PATCH v2] staging:rtl8723au: core: Fix error reported by 
checkpatch.

On Wed, 2014-11-05 at 17:05 +0530, Sanjeev Sharma wrote:
 This is a patch to the rtw_cmd.c file that fixes Error reported by 
 checkpatch.

Please run your patches through checkpatch before sending them.

In this patch I am fixing error reported by check patch since Error has higher 
priority. 

WARNING: suspect code indent for conditional statements (24, 24)
#178: FILE: drivers/staging/rtl8723au/core/rtw_cmd.c:1025:
+   if (check_fwstate(pmlmepriv, _FW_LINKED))
LPS_Leave23a(padapter);

Also, there are a couple of different things you changing here.

This should be 2 separate patches.

Ok I will come up with 2 patch separately.

One to use the temporary for:
+   struct rt_link_detect *ldi = pmlmepriv-LinkDetectInfo;

(and that bit has a defect here:


+   } else {
LPS_Leave23a(padapter);
+   }

where the indentation for the last close brace is wrong)

and another for the whitespace only changes


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH v2] staging:rtl8723au: core: Fix error reported by checkpatch.

2014-11-05 Thread Sharma, Sanjeev
-Original Message-
From: Greg KH [mailto:gre...@linuxfoundation.org] 
Sent: Wednesday, November 05, 2014 9:58 PM
To: Sharma, Sanjeev
Cc: larry.fin...@lwfinger.net; jes.soren...@redhat.com; 
de...@driverdev.osuosl.org; linux-wirel...@vger.kernel.org; 
linux-ker...@vger.kernel.org
Subject: Re: [PATCH v2] staging:rtl8723au: core: Fix error reported by 
checkpatch.

On Wed, Nov 05, 2014 at 05:05:03PM +0530, Sanjeev Sharma wrote:
 This is a patch to the rtw_cmd.c file that fixes Error reported by 
 checkpatch.

What error are you fixing?  Please be specific.

Submitted individual patch with detail of fix.

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel