* [PATCH] staging: rtl8723bs: fix unbalanced braces in rtw_recv.c
@ 2026-05-12 5:08 Jennifer Guo
0 siblings, 0 replies; only message in thread
From: Jennifer Guo @ 2026-05-12 5:08 UTC (permalink / raw)
To: linux-staging; +Cc: gregkh, Jennifer Guo
Add missing braces to if/else statements to comply with kernel coding
style.
This fixes the following checkpatch.pl checks for rtw_recv.c:
- CHECK: Unbalanced braces around else statement
- CHECK: braces {} should be used on all arms of this statement
Signed-off-by: Jennifer Guo <guojy.bj@gmail.com>
---
drivers/staging/rtl8723bs/core/rtw_recv.c | 30 ++++++++++++++---------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c
index e9ec6def7216..86c5e2c4e7dd 100644
--- a/drivers/staging/rtl8723bs/core/rtw_recv.c
+++ b/drivers/staging/rtl8723bs/core/rtw_recv.c
@@ -115,9 +115,9 @@ union recv_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue)
struct adapter *padapter;
struct recv_priv *precvpriv;
- if (list_empty(&pfree_recv_queue->queue))
+ if (list_empty(&pfree_recv_queue->queue)) {
precvframe = NULL;
- else {
+ } else {
phead = get_list_head(pfree_recv_queue);
plist = get_next(phead);
@@ -276,9 +276,9 @@ struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue)
spin_lock_bh(&queue->lock);
- if (list_empty(&queue->queue))
+ if (list_empty(&queue->queue)) {
precvbuf = NULL;
- else {
+ } else {
phead = get_list_head(queue);
plist = get_next(phead);
@@ -471,8 +471,9 @@ static union recv_frame *decryptor(struct adapter *padapter, union recv_frame *p
if (res == _FAIL) {
rtw_free_recvframe(return_packet, &padapter->recvpriv.free_recv_queue);
return_packet = NULL;
- } else
+ } else {
prxattrib->bdecrypted = true;
+ }
return return_packet;
}
@@ -518,9 +519,9 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre
memcpy(&be_tmp, ptr, 2);
ether_type = ntohs(be_tmp);
- if (ether_type == eapol_type)
+ if (ether_type == eapol_type) {
prtnframe = precv_frame;
- else {
+ } else {
/* free this frame */
rtw_free_recvframe(precv_frame, &adapter->recvpriv.free_recv_queue);
prtnframe = NULL;
@@ -539,8 +540,9 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre
/* else { */
/* */
}
- } else
+ } else {
prtnframe = precv_frame;
+ }
return prtnframe;
}
@@ -746,8 +748,9 @@ static signed int sta2sta_data_frame(struct adapter *adapter, union recv_frame *
memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
sta_addr = mybssid;
- } else
+ } else {
ret = _FAIL;
+ }
if (bmcast)
*psta = rtw_get_bcmc_stainfo(adapter);
@@ -1144,10 +1147,12 @@ static union recv_frame *recvframe_chk_defrag(struct adapter *padapter, union re
if (type != WIFI_DATA_TYPE) {
psta = rtw_get_bcmc_stainfo(padapter);
pdefrag_q = &psta->sta_recvpriv.defrag_q;
- } else
+ } else {
pdefrag_q = NULL;
- } else
+ }
+ } else {
pdefrag_q = &psta->sta_recvpriv.defrag_q;
+ }
if ((ismfrag == 0) && (fragnum == 0))
prtnframe = precv_frame;/* isn't a fragment frame */
@@ -1530,9 +1535,10 @@ static signed int wlanhdr_to_ethhdr(union recv_frame *precvframe)
!memcmp(psnap, bridge_tunnel_header, SNAP_SIZE)) {
/* remove RFC1042 or Bridge-Tunnel encapsulation and replace EtherType */
bsnaphdr = true;
- } else
+ } else {
/* Leave Ethernet header part of hdr and full payload */
bsnaphdr = false;
+ }
rmv_len = pattrib->hdrlen + pattrib->iv_len + (bsnaphdr ? SNAP_SIZE : 0);
len = precvframe->u.hdr.len - rmv_len;
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-05-12 5:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 5:08 [PATCH] staging: rtl8723bs: fix unbalanced braces in rtw_recv.c Jennifer Guo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox