From 147e45d9210ce303eb8a3a3c6593631ff78cd072 Mon Sep 17 00:00:00 2001 From: Roberta Dobrescu Date: Sun, 26 Oct 2014 23:30:07 +0200 Subject: [PATCH] staging: rtl8723au: hal: Remove uneeded return variable 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 Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 17 +++++------------ drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 7 ++----- .../staging/rtl8723au/hal/rtl8723a_hal_init.c | 14 ++++---------- drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c | 3 +-- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index 9054a987f06b..5de806e45c3b 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -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 diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index 271c33d6ca5a..7b56411cc3c8 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -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 */ diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index 1ccf60a9e528..9a75eb6bb5a3 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -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) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c index 3d4d7ec27509..88e91cd8ebb9 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_phycfg.c @@ -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; } /** -- 2.30.2