From: Jennifer Guo <guojy.bj@gmail.com>
To: linux-staging@lists.linux.dev
Cc: gregkh@linuxfoundation.org, Jennifer Guo <guojy.bj@gmail.com>
Subject: [PATCH] staging: rtl8723bs: fix unbalanced braces in rtw_recv.c
Date: Mon, 11 May 2026 22:08:26 -0700 [thread overview]
Message-ID: <20260512050826.3117-1-guojy.bj@gmail.com> (raw)
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
reply other threads:[~2026-05-12 5:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512050826.3117-1-guojy.bj@gmail.com \
--to=guojy.bj@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-staging@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox