staging: rtl8723au: hal: Remove useless intialisation
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Thu, 15 Oct 2015 08:04:41 +0000 (13:34 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 05:10:37 +0000 (22:10 -0700)
Remove intialisation of a variable that is immediately reassigned. The
problem was found using coccinelle semantic patch and further
opportunities were identified by hand.

The semantic patch used to find this is:

// <smpl>
@@
type T;
identifier x;
constant C;
expression e;
@@

T x
- = C
 ;
x = e;
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c

index 0052a91fdb12528fa578e7b8272725c09655dee5..d5c48a56d4aca7b63c892d5f20670f2177eba610 100644 (file)
@@ -5644,7 +5644,7 @@ static void btdm_1AntTdmaDurationAdjustForACL(struct rtw_adapter *padapter)
                    (pBtdm8723->curPsTdma != 11)) {
                        btdm_1AntSetPSTDMA(padapter, true, 0, true, pBtdm8723->psTdmaDuAdjType);
                } else {
-                       s32 judge = 0;
+                       s32 judge;
 
                        judge = btdm_1AntTdmaJudgement(padapter, pHalData->bt_coexist.halCoex8723.btRetryCnt);
                        if (judge == -1) {
@@ -9075,7 +9075,7 @@ static void btdm_BTCoexist8723AHandler(struct rtw_adapter *padapter)
 u32 BTDM_BtTxRxCounterH(struct rtw_adapter *padapter)
 {
        struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-       u32     counters = 0;
+       u32     counters;
 
        counters = pHalData->bt_coexist.halCoex8723.highPriorityTx+
                pHalData->bt_coexist.halCoex8723.highPriorityRx;
@@ -9085,7 +9085,7 @@ u32 BTDM_BtTxRxCounterH(struct rtw_adapter *padapter)
 u32 BTDM_BtTxRxCounterL(struct rtw_adapter *padapter)
 {
        struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-       u32     counters = 0;
+       u32     counters;
 
        counters = pHalData->bt_coexist.halCoex8723.lowPriorityTx+
                pHalData->bt_coexist.halCoex8723.lowPriorityRx;
@@ -9297,7 +9297,7 @@ static void BTDM_AdjustForBtOperation8723A(struct rtw_adapter *padapter)
 static void BTDM_FwC2hBtRssi8723A(struct rtw_adapter *padapter, u8 *tmpBuf)
 {
        struct hal_data_8723a *pHalData = GET_HAL_DATA(padapter);
-       u8 percent = 0, u1tmp = 0;
+       u8 percent, u1tmp;
 
        u1tmp = tmpBuf[0];
        percent = u1tmp*2+10;