staging: rtl8723bs: Fix indenting errors and an off-by-one mistake in core/rtw_mlme_ext.c

Smatch lists the following:

  CHECK   drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:525 _mgt_dispatcher() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:1595 OnAssocReq() error: buffer overflow 'pstapriv->sta_aid' 32 <= 32
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2391 dump_mgntframe_and_wait() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:2420 dump_mgntframe_and_wait_ack() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:4969 process_80211d() error: testing array offset 'i' after use.
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:5738 linked_status_chk() warn: inconsistent indenting
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c:6459 sitesurvey_cmd_hdl() warn: inconsistent indenting

The indenting problems were fixed with white-space changes. The error at
line 1595 was the result of an off-by-one error in a for loop. The error
at line 4969 was not fixed as that code lies inside a block of code that
only is needed for 5G channels. This chip only works at 2.4 GHz.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Larry Finger 2017-04-08 11:07:43 -05:00 committed by Greg Kroah-Hartman
parent 3498d6844c
commit ef9209b642

View file

@ -522,15 +522,14 @@ static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptabl
u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; u8 bc_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
u8 *pframe = precv_frame->u.hdr.rx_data; u8 *pframe = precv_frame->u.hdr.rx_data;
if (ptable->func) { if (ptable->func) {
/* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */
if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) &&
memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN)) memcmp(GetAddr1Ptr(pframe), bc_addr, ETH_ALEN))
return; return;
ptable->func(padapter, precv_frame);
}
ptable->func(padapter, precv_frame);
}
} }
void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame) void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame)
@ -1575,7 +1574,7 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
if (pstat->aid > 0) { if (pstat->aid > 0) {
DBG_871X(" old AID %d\n", pstat->aid); DBG_871X(" old AID %d\n", pstat->aid);
} else { } else {
for (pstat->aid = 1; pstat->aid <= NUM_STA; pstat->aid++) for (pstat->aid = 1; pstat->aid < NUM_STA; pstat->aid++)
if (pstapriv->sta_aid[pstat->aid - 1] == NULL) if (pstapriv->sta_aid[pstat->aid - 1] == NULL)
break; break;
@ -2388,7 +2387,7 @@ s32 dump_mgntframe_and_wait(struct adapter *padapter, struct xmit_frame *pmgntfr
pxmitbuf->sctx = NULL; pxmitbuf->sctx = NULL;
spin_unlock_irqrestore(&pxmitpriv->lock_sctx, irqL); spin_unlock_irqrestore(&pxmitpriv->lock_sctx, irqL);
return ret; return ret;
} }
s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe) s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmgntframe)
@ -2417,7 +2416,7 @@ s32 dump_mgntframe_and_wait_ack(struct adapter *padapter, struct xmit_frame *pmg
mutex_unlock(&pxmitpriv->ack_tx_mutex); mutex_unlock(&pxmitpriv->ack_tx_mutex);
} }
return ret; return ret;
} }
static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode)
@ -5735,7 +5734,7 @@ void linked_status_chk(struct adapter *padapter)
#else #else
rx_chk_limit = 8; rx_chk_limit = 8;
#endif #endif
link_count_limit = 7; /* 16 sec */ link_count_limit = 7; /* 16 sec */
/* Marked by Kurt 20130715 */ /* Marked by Kurt 20130715 */
/* For WiDi 3.5 and latered on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. */ /* For WiDi 3.5 and latered on, they don't ask WiDi sink to do roaming, so we could not check rx limit that strictly. */
@ -6456,7 +6455,7 @@ u8 sitesurvey_cmd_hdl(struct adapter *padapter, u8 *pbuf)
Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false); Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, false);
/* config the initial gain under scaning, need to write the BB registers */ /* config the initial gain under scaning, need to write the BB registers */
initialgain = 0x1e; initialgain = 0x1e;
rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain)); rtw_hal_set_hwreg(padapter, HW_VAR_INITIAL_GAIN, (u8 *)(&initialgain));