Commit 0b4d1d0d authored by Michael Straube's avatar Michael Straube Committed by Greg Kroah-Hartman

staging: rtl8188eu: remove else after break or return

Remove unnecessary else after break or return to improve readability
and clear checkpatch warnings.

WARNING: else is not generally useful after a break or return
Signed-off-by: default avatarMichael Straube <straube.linux@gmail.com>
Link: https://lore.kernel.org/r/20200118173343.32405-1-straube.linux@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 27f391a5
...@@ -497,8 +497,8 @@ static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, u8 efuseType, st ...@@ -497,8 +497,8 @@ static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, u8 efuseType, st
if (!PgWriteSuccess) if (!PgWriteSuccess)
return false; return false;
else
efuse_addr = Efuse_GetCurrentSize(pAdapter); efuse_addr = Efuse_GetCurrentSize(pAdapter);
} else { } else {
efuse_addr = efuse_addr + (pFixPkt->word_cnts * 2) + 1; efuse_addr = efuse_addr + (pFixPkt->word_cnts * 2) + 1;
} }
...@@ -713,10 +713,9 @@ static bool hal_EfusePartialWriteCheck(struct adapter *pAdapter, u8 efuseType, u ...@@ -713,10 +713,9 @@ static bool hal_EfusePartialWriteCheck(struct adapter *pAdapter, u8 efuseType, u
if (ALL_WORDS_DISABLED(efuse_data)) { if (ALL_WORDS_DISABLED(efuse_data)) {
ret = false; ret = false;
break; break;
} else {
curPkt.offset = ((cur_header & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1);
curPkt.word_en = efuse_data & 0x0F;
} }
curPkt.offset = ((cur_header & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1);
curPkt.word_en = efuse_data & 0x0F;
} else { } else {
cur_header = efuse_data; cur_header = efuse_data;
curPkt.offset = (cur_header >> 4) & 0x0F; curPkt.offset = (cur_header >> 4) & 0x0F;
......
...@@ -157,11 +157,10 @@ u8 *rtw_get_ie(u8 *pbuf, int index, uint *len, int limit) ...@@ -157,11 +157,10 @@ u8 *rtw_get_ie(u8 *pbuf, int index, uint *len, int limit)
if (*p == index) { if (*p == index) {
*len = *(p + 1); *len = *(p + 1);
return p; return p;
} else {
tmp = *(p + 1);
p += (tmp + 2);
i += (tmp + 2);
} }
tmp = *(p + 1);
p += (tmp + 2);
i += (tmp + 2);
if (i >= limit) if (i >= limit)
break; break;
} }
...@@ -295,10 +294,9 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, uint *wpa_ie_len, int limit) ...@@ -295,10 +294,9 @@ unsigned char *rtw_get_wpa_ie(unsigned char *pie, uint *wpa_ie_len, int limit)
goto check_next_ie; goto check_next_ie;
*wpa_ie_len = *(pbuf + 1); *wpa_ie_len = *(pbuf + 1);
return pbuf; return pbuf;
} else {
*wpa_ie_len = 0;
return NULL;
} }
*wpa_ie_len = 0;
return NULL;
check_next_ie: check_next_ie:
limit_new = limit - (pbuf - pie) - 2 - len; limit_new = limit - (pbuf - pie) - 2 - len;
...@@ -596,9 +594,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen) ...@@ -596,9 +594,8 @@ u8 *rtw_get_wps_ie(u8 *in_ie, uint in_len, u8 *wps_ie, uint *wps_ielen)
cnt += in_ie[cnt + 1] + 2; cnt += in_ie[cnt + 1] + 2;
break; break;
} else {
cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
cnt += in_ie[cnt + 1] + 2; /* goto next */
} }
return wpsie_ptr; return wpsie_ptr;
} }
...@@ -642,9 +639,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att ...@@ -642,9 +639,8 @@ u8 *rtw_get_wps_attr(u8 *wps_ie, uint wps_ielen, u16 target_attr_id, u8 *buf_att
if (len_attr) if (len_attr)
*len_attr = attr_len; *len_attr = attr_len;
break; break;
} else {
attr_ptr += attr_len; /* goto next */
} }
attr_ptr += attr_len; /* goto next */
} }
return target_attr_ptr; return target_attr_ptr;
} }
......
...@@ -1865,6 +1865,7 @@ unsigned int send_beacon(struct adapter *padapter) ...@@ -1865,6 +1865,7 @@ unsigned int send_beacon(struct adapter *padapter)
int issue = 0; int issue = 0;
int poll = 0; int poll = 0;
unsigned long start = jiffies; unsigned long start = jiffies;
u32 passing_time;
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
do { do {
...@@ -1883,15 +1884,14 @@ unsigned int send_beacon(struct adapter *padapter) ...@@ -1883,15 +1884,14 @@ unsigned int send_beacon(struct adapter *padapter)
DBG_88E("%s fail! %u ms\n", __func__, DBG_88E("%s fail! %u ms\n", __func__,
jiffies_to_msecs(jiffies - start)); jiffies_to_msecs(jiffies - start));
return _FAIL; return _FAIL;
} else {
u32 passing_time = jiffies_to_msecs(jiffies - start);
if (passing_time > 100 || issue > 3)
DBG_88E("%s success, issue:%d, poll:%d, %u ms\n",
__func__, issue, poll,
jiffies_to_msecs(jiffies - start));
return _SUCCESS;
} }
passing_time = jiffies_to_msecs(jiffies - start);
if (passing_time > 100 || issue > 3)
DBG_88E("%s success, issue:%d, poll:%d, %u ms\n",
__func__, issue, poll,
jiffies_to_msecs(jiffies - start));
return _SUCCESS;
} }
/**************************************************************************** /****************************************************************************
...@@ -2864,10 +2864,9 @@ static unsigned int OnAuthClient(struct adapter *padapter, ...@@ -2864,10 +2864,9 @@ static unsigned int OnAuthClient(struct adapter *padapter,
set_link_timer(pmlmeext, REAUTH_TO); set_link_timer(pmlmeext, REAUTH_TO);
return _SUCCESS; return _SUCCESS;
} else {
/* open system */
go2asoc = 1;
} }
/* open system */
go2asoc = 1;
} else if (seq == 4) { } else if (seq == 4) {
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared) if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_Shared)
go2asoc = 1; go2asoc = 1;
...@@ -3453,14 +3452,13 @@ static unsigned int OnDeAuth(struct adapter *padapter, ...@@ -3453,14 +3452,13 @@ static unsigned int OnDeAuth(struct adapter *padapter,
} }
return _SUCCESS; return _SUCCESS;
} else }
#endif #endif
{ DBG_88E_LEVEL(_drv_always_, "sta recv deauth reason code(%d) sta:%pM\n",
DBG_88E_LEVEL(_drv_always_, "sta recv deauth reason code(%d) sta:%pM\n", reason, GetAddr3Ptr(pframe));
reason, GetAddr3Ptr(pframe));
receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
}
pmlmepriv->LinkDetectInfo.bBusyTraffic = false; pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
return _SUCCESS; return _SUCCESS;
} }
...@@ -3507,14 +3505,13 @@ static unsigned int OnDisassoc(struct adapter *padapter, ...@@ -3507,14 +3505,13 @@ static unsigned int OnDisassoc(struct adapter *padapter,
} }
return _SUCCESS; return _SUCCESS;
} else }
#endif #endif
{ DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n",
DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n", reason, GetAddr3Ptr(pframe));
reason, GetAddr3Ptr(pframe));
receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
}
pmlmepriv->LinkDetectInfo.bBusyTraffic = false; pmlmepriv->LinkDetectInfo.bBusyTraffic = false;
return _SUCCESS; return _SUCCESS;
} }
...@@ -5277,10 +5274,10 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf) ...@@ -5277,10 +5274,10 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key); write_cam(padapter, cam_id, ctrl, pparm->addr, pparm->key);
return H2C_SUCCESS_RSP; return H2C_SUCCESS_RSP;
} else {
DBG_88E("r871x_set_stakey_hdl(): sta has been free\n");
return H2C_REJECTED;
} }
DBG_88E("r871x_set_stakey_hdl(): sta has been free\n");
return H2C_REJECTED;
} }
/* below for sta mode */ /* below for sta mode */
......
...@@ -1247,9 +1247,8 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) ...@@ -1247,9 +1247,8 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
if (ralink_vendor_flag) { if (ralink_vendor_flag) {
DBG_88E("link to Tenda W311R AP\n"); DBG_88E("link to Tenda W311R AP\n");
return HT_IOT_PEER_TENDA; return HT_IOT_PEER_TENDA;
} else {
DBG_88E("Capture EPIGRAM_OUI\n");
} }
DBG_88E("Capture EPIGRAM_OUI\n");
} else { } else {
break; break;
} }
...@@ -1266,10 +1265,9 @@ unsigned char check_assoc_AP(u8 *pframe, uint len) ...@@ -1266,10 +1265,9 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
} else if (ralink_vendor_flag && epigram_vendor_flag) { } else if (ralink_vendor_flag && epigram_vendor_flag) {
DBG_88E("link to Tenda W311R AP\n"); DBG_88E("link to Tenda W311R AP\n");
return HT_IOT_PEER_TENDA; return HT_IOT_PEER_TENDA;
} else {
DBG_88E("link to new AP\n");
return HT_IOT_PEER_UNKNOWN;
} }
DBG_88E("link to new AP\n");
return HT_IOT_PEER_UNKNOWN;
} }
void update_IOT_info(struct adapter *padapter) void update_IOT_info(struct adapter *padapter)
......
...@@ -1022,10 +1022,10 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct ...@@ -1022,10 +1022,10 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
ClearMFrag(mem_start); ClearMFrag(mem_start);
break; break;
} else {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __func__));
} }
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __func__));
addr = (size_t)(pframe); addr = (size_t)(pframe);
mem_start = (unsigned char *)round_up(addr, 4) + hw_hdr_offset; mem_start = (unsigned char *)round_up(addr, 4) + hw_hdr_offset;
......
...@@ -967,10 +967,11 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm) ...@@ -967,10 +967,11 @@ void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm)
pDM_Odm->RFCalibrateInfo.TM_Trigger = 1; pDM_Odm->RFCalibrateInfo.TM_Trigger = 1;
return; return;
} else {
rtl88eu_dm_txpower_tracking_callback_thermalmeter(Adapter);
pDM_Odm->RFCalibrateInfo.TM_Trigger = 0;
} }
rtl88eu_dm_txpower_tracking_callback_thermalmeter(Adapter);
pDM_Odm->RFCalibrateInfo.TM_Trigger = 0;
} }
/* 3============================================================ */ /* 3============================================================ */
......
...@@ -923,27 +923,27 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8], ...@@ -923,27 +923,27 @@ static bool simularity_compare(struct adapter *adapt, s32 resulta[][8],
} }
} }
return result; return result;
} else { }
if (!(sim_bitmap & 0x03)) { /* path A TX OK */
for (i = 0; i < 2; i++)
resulta[3][i] = resulta[c1][i];
}
if (!(sim_bitmap & 0x0c)) { /* path A RX OK */
for (i = 2; i < 4; i++)
resulta[3][i] = resulta[c1][i];
}
if (!(sim_bitmap & 0x30)) { /* path B TX OK */ if (!(sim_bitmap & 0x03)) { /* path A TX OK */
for (i = 4; i < 6; i++) for (i = 0; i < 2; i++)
resulta[3][i] = resulta[c1][i]; resulta[3][i] = resulta[c1][i];
} }
if (!(sim_bitmap & 0x0c)) { /* path A RX OK */
for (i = 2; i < 4; i++)
resulta[3][i] = resulta[c1][i];
}
if (!(sim_bitmap & 0xc0)) { /* path B RX OK */ if (!(sim_bitmap & 0x30)) { /* path B TX OK */
for (i = 6; i < 8; i++) for (i = 4; i < 6; i++)
resulta[3][i] = resulta[c1][i]; resulta[3][i] = resulta[c1][i];
} }
return false;
if (!(sim_bitmap & 0xc0)) { /* path B RX OK */
for (i = 6; i < 8; i++)
resulta[3][i] = resulta[c1][i];
} }
return false;
} }
static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
...@@ -1053,10 +1053,9 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8], ...@@ -1053,10 +1053,9 @@ static void phy_iq_calibrate(struct adapter *adapt, s32 result[][8],
result[t][3] = (phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2, result[t][3] = (phy_query_bb_reg(adapt, rRx_Power_After_IQK_A_2,
bMaskDWord)&0x3FF0000)>>16; bMaskDWord)&0x3FF0000)>>16;
break; break;
} else {
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
("Path A Rx IQK Fail!!\n"));
} }
ODM_RT_TRACE(dm_odm, ODM_COMP_CALIBRATION, ODM_DBG_LOUD,
("Path A Rx IQK Fail!!\n"));
} }
if (path_a_ok == 0x00) { if (path_a_ok == 0x00) {
......
...@@ -596,9 +596,8 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie ...@@ -596,9 +596,8 @@ static int rtw_set_wpa_ie(struct adapter *padapter, char *pie, unsigned short ie
set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS); set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS);
cnt += buf[cnt+1]+2; cnt += buf[cnt+1]+2;
break; break;
} else {
cnt += buf[cnt+1]+2; /* goto next */
} }
cnt += buf[cnt+1]+2; /* goto next */
} }
} }
} }
...@@ -773,8 +772,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev, ...@@ -773,8 +772,7 @@ static int rtw_wx_set_pmkid(struct net_device *dev,
DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n"); DBG_88E("[rtw_wx_set_pmkid] IW_PMKSA_ADD!\n");
if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN)) if (!memcmp(strIssueBssid, strZeroMacAddress, ETH_ALEN))
return ret; return ret;
else ret = true;
ret = true;
blInserted = false; blInserted = false;
/* overwrite PMKID */ /* overwrite PMKID */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment