[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <61ec6328ccb22696ccc769ce9fbbe26fd00cd04a.1573605920.git.jarias.linux@gmail.com>
Date: Tue, 12 Nov 2019 20:34:13 -0500
From: "Javier F. Arias" <jarias.linux@...il.com>
To: gregkh@...uxfoundation.org
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/4] staging: rtl8723bs: Add necessary braces
This patch adds braces when they should be used on all arms of
the statement.
Issue found by Checkpatch.
Signed-off-by: Javier F. Arias <jarias.linux@...il.com>
---
Changes in V2:
- Add braces and balance statements in the same patch instead
of performing a new change in a subsequent patch.
- Fix a typo in the commit description.
drivers/staging/rtl8723bs/core/rtw_xmit.c | 34 +++++++++++++----------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c
index fdb585ff5925..44fc604ea5b7 100644
--- a/drivers/staging/rtl8723bs/core/rtw_xmit.c
+++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c
@@ -370,9 +370,9 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
/* Other fragments are protected by previous fragment. */
/* So we only need to check the length of first fragment. */
if (pmlmeext->cur_wireless_mode < WIRELESS_11_24N || padapter->registrypriv.wifi_spec) {
- if (sz > padapter->registrypriv.rts_thresh)
+ if (sz > padapter->registrypriv.rts_thresh) {
pattrib->vcs_mode = RTS_CTS;
- else {
+ } else {
if (pattrib->rtsen)
pattrib->vcs_mode = RTS_CTS;
else if (pattrib->cts2self)
@@ -679,8 +679,9 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
memcpy(pattrib->ta, get_bssid(pmlmepriv), ETH_ALEN);
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_ap);
- } else
+ } else {
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown);
+ }
pattrib->pktlen = pktfile.pkt_len;
@@ -724,9 +725,9 @@ static s32 update_attrib(struct adapter *padapter, _pkt *pkt, struct pkt_attrib
rtw_set_scan_deny(padapter, 3000);
/* If EAPOL , ARP , OR DHCP packet, driver must be in active mode. */
- if (pattrib->icmp_pkt == 1)
+ if (pattrib->icmp_pkt == 1) {
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 1);
- else if (pattrib->dhcp_pkt == 1) {
+ } else if (pattrib->dhcp_pkt == 1) {
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_active);
rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_SPECIAL_PACKET, 1);
}
@@ -926,8 +927,9 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi
default:
break;
}
- } else
+ } else {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_notice_, ("### xmitframe_hwencrypt\n"));
+ }
return _SUCCESS;
}
@@ -1204,8 +1206,9 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, _pkt *pkt, struct xmit_fram
ClearMFrag(mem_start);
break;
- } else
+ } else {
RT_TRACE(_module_rtl871x_xmit_c_, _drv_err_, ("%s: There're still something in packet!\n", __func__));
+ }
addr = (SIZE_PTR)(pframe);
@@ -1446,17 +1449,18 @@ void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len)
case AUTO_VCS:
default:
perp = rtw_get_ie(ie, _ERPINFO_IE_, &erp_len, ie_len);
- if (!perp)
+ if (!perp) {
pxmitpriv->vcs = NONE_VCS;
- else {
+ } else {
protection = (*(perp + 2)) & BIT(1);
if (protection) {
if (pregistrypriv->vcs_type == RTS_CTS)
pxmitpriv->vcs = RTS_CTS;
else
pxmitpriv->vcs = CTS_TO_SELF;
- } else
+ } else {
pxmitpriv->vcs = NONE_VCS;
+ }
}
break;
@@ -1509,8 +1513,9 @@ static struct xmit_buf *__rtw_alloc_cmd_xmitbuf(struct xmit_priv *pxmitpriv,
DBG_871X("%s pxmitbuf->sctx is not NULL\n", __func__);
rtw_sctx_done_err(&pxmitbuf->sctx, RTW_SCTX_DONE_BUF_ALLOC);
}
- } else
+ } else {
DBG_871X("%s fail, no xmitbuf available !!!\n", __func__);
+ }
return pxmitbuf;
}
@@ -2177,11 +2182,12 @@ inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe)
, attrib->ether_type, attrib->dhcp_pkt?" DHCP":"");
allow = true;
}
- } else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL)
+ } else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_ALL) {
allow = true;
- else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) {
- } else
+ } else if (registry->hiq_filter == RTW_HIQ_FILTER_DENY_ALL) {
+ } else {
rtw_warn_on(1);
+ }
return allow;
}
--
2.20.1
Powered by blists - more mailing lists