staging: rtl8723au: hal: Remove uneeded return variable
authorRoberta Dobrescu <roberta.dobrescu@gmail.com>
Sun, 26 Oct 2014 21:30:07 +0000 (23:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Oct 2014 10:45:03 +0000 (18:45 +0800)
This patch removes uneeded return variables, just using
'return _SUCCESS' or 'return HCI_STATUS_SUCCESS' instead.
This fixes the following warning detected using coccinelle:
Unneeded variable.

It was done using the following semantic patch:

@@
identifier ret;
type T;
expression e;
@@

-T ret = e;
 ... when != ret
     when strict
-return ret;
+return e;

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c
drivers/staging/rtl8723au/hal/rtl8723a_cmd.c
drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c
drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c

index 9054a987f06bd81caad20d8c03f45688bb17802c..5de806e45c3b83dd59d71c9646b06e808495483f 100644 (file)
@@ -1766,9 +1766,7 @@ bthci_CmdSetEventFilter(
        struct packet_irp_hcicmd_data *pHciCmd
        )
 {
-       enum hci_status status = HCI_STATUS_SUCCESS;
-
-       return status;
+       return HCI_STATUS_SUCCESS;
 }
 
 /* 7.3.14 */
@@ -2984,8 +2982,7 @@ bthci_CmdReadLinkQuality(
 
 static enum hci_status bthci_CmdReadRSSI(struct rtw_adapter *padapter)
 {
-       enum hci_status status = HCI_STATUS_SUCCESS;
-       return status;
+       return HCI_STATUS_SUCCESS;
 }
 
 static enum hci_status
@@ -2994,7 +2991,6 @@ bthci_CmdCreateLogicalLink(
        struct packet_irp_hcicmd_data *pHciCmd
        )
 {
-       enum hci_status status = HCI_STATUS_SUCCESS;
        struct bt_30info *pBTInfo = GET_BT_INFO(padapter);
        struct bt_dgb *pBtDbg = &pBTInfo->BtDbg;
 
@@ -3003,7 +2999,7 @@ bthci_CmdCreateLogicalLink(
        bthci_BuildLogicalLink(padapter, pHciCmd,
                HCI_CREATE_LOGICAL_LINK);
 
-       return status;
+       return HCI_STATUS_SUCCESS;
 }
 
 static enum hci_status
@@ -3012,7 +3008,6 @@ bthci_CmdAcceptLogicalLink(
        struct packet_irp_hcicmd_data *pHciCmd
        )
 {
-       enum hci_status status = HCI_STATUS_SUCCESS;
        struct bt_30info *pBTInfo = GET_BT_INFO(padapter);
        struct bt_dgb *pBtDbg = &pBTInfo->BtDbg;
 
@@ -3021,7 +3016,7 @@ bthci_CmdAcceptLogicalLink(
        bthci_BuildLogicalLink(padapter, pHciCmd,
                HCI_ACCEPT_LOGICAL_LINK);
 
-       return status;
+       return HCI_STATUS_SUCCESS;
 }
 
 static enum hci_status
@@ -4141,9 +4136,7 @@ static enum hci_status
 bthci_CmdHostNumberOfCompletedPackets(struct rtw_adapter *padapter,
                                      struct packet_irp_hcicmd_data *pHciCmd)
 {
-       enum hci_status status = HCI_STATUS_SUCCESS;
-
-       return status;
+       return HCI_STATUS_SUCCESS;
 }
 
 static enum hci_status
index 271c33d6ca5af87c901dc1e88e43e63950c58742..7b56411cc3c8130c5cf70d816a57459ac4b8a5fc 100644 (file)
@@ -115,19 +115,16 @@ exit:
 
 int rtl8723a_set_rssi_cmd(struct rtw_adapter *padapter, u8 *param)
 {
-       int res = _SUCCESS;
-
        *((u32 *)param) = cpu_to_le32(*((u32 *)param));
 
        FillH2CCmd(padapter, RSSI_SETTING_EID, 3, param);
 
-       return res;
+       return _SUCCESS;
 }
 
 int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg)
 {
        u8 buf[5];
-       int res = _SUCCESS;
 
        memset(buf, 0, 5);
        mask = cpu_to_le32(mask);
@@ -136,7 +133,7 @@ int rtl8723a_set_raid_cmd(struct rtw_adapter *padapter, u32 mask, u8 arg)
 
        FillH2CCmd(padapter, MACID_CONFIG_EID, 5, buf);
 
-       return res;
+       return _SUCCESS;
 }
 
 /* bitmap[0:27] = tx_rate_bitmap */
index 1ccf60a9e528c6aa593a35a32c0dbecf795944aa..9a75eb6bb5a3c094efce06f268f2f0318bff49e5 100644 (file)
@@ -1522,10 +1522,8 @@ static void _DisableAnalog(struct rtw_adapter *padapter, bool bWithoutHWSM)
 /*  HW Auto state machine */
 int CardDisableHWSM(struct rtw_adapter *padapter, u8 resetMCU)
 {
-       int rtStatus = _SUCCESS;
-
        if (padapter->bSurpriseRemoved) {
-               return rtStatus;
+               return _SUCCESS;
        }
        /*  RF Off Sequence ==== */
        _DisableRFAFEAndResetBB(padapter);
@@ -1542,18 +1540,14 @@ int CardDisableHWSM(struct rtw_adapter *padapter, u8 resetMCU)
        RT_TRACE(_module_hci_hal_init_c_, _drv_info_,
                 ("======> Card disable finished.\n"));
 
-       return rtStatus;
+       return _SUCCESS;
 }
 
 /*  without HW Auto state machine */
 int CardDisableWithoutHWSM(struct rtw_adapter *padapter)
 {
-       int rtStatus = _SUCCESS;
-
-       /* RT_TRACE(COMP_INIT, DBG_LOUD,
-          ("======> Card Disable Without HWSM .\n")); */
        if (padapter->bSurpriseRemoved) {
-               return rtStatus;
+               return _SUCCESS;
        }
 
        /*  RF Off Sequence ==== */
@@ -1573,7 +1567,7 @@ int CardDisableWithoutHWSM(struct rtw_adapter *padapter)
 
        /* RT_TRACE(COMP_INIT, DBG_LOUD,
           ("<====== Card Disable Without HWSM .\n")); */
-       return rtStatus;
+       return _SUCCESS;
 }
 
 void Hal_InitPGData(struct rtw_adapter *padapter, u8 *PROMContent)
index 3d4d7ec275099c4ba3d28921f3a76fecede7dade..88e91cd8ebb9cd16fe2b6ee63b0d299d869d82b3 100644 (file)
@@ -418,7 +418,6 @@ PHY_SetRFReg(struct rtw_adapter *Adapter, enum RF_RADIO_PATH eRFPath,
  *---------------------------------------------------------------------------*/
 int PHY_MACConfig8723A(struct rtw_adapter *Adapter)
 {
-       int rtStatus = _SUCCESS;
        struct hal_data_8723a *pHalData = GET_HAL_DATA(Adapter);
        bool is92C = IS_92C_SERIAL(pHalData->VersionID);
 
@@ -433,7 +432,7 @@ int PHY_MACConfig8723A(struct rtw_adapter *Adapter)
        if (is92C && (BOARD_USB_DONGLE == pHalData->BoardType))
                rtl8723au_write8(Adapter, 0x40, 0x04);
 
-       return rtStatus;
+       return _SUCCESS;
 }
 
 /**