staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe
PATCH 1/1 staging: rtl8723bs: fix while loop checkpatch logic in enqueue_reorder_recvframe
The checkpatch.pl tool reports a warning for using an unnecessary else after a return statement. This patch refactors the while loop logic in enqueue_reorder_recvframe to remove the unnecessary else block and improve code style.
Signed-off-by Hussien Sajjad Ali <[email protected]>
--- drivers/staging/rtl8723bs/core/rtw_recv.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rtl8723bs/core/rtw_recv.c +9 -9
@@ -1763,7 +1763,6 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_nreturn true; } -static int enqueue_reorder_recvframe (struct recv_reorder_ctrl *preorder_ctrl,union recv_frame *prframe) {struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
@@ -1782,16 +1781,17 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl, un pnextrframe = (union recv_frame *)plist; pnextattrib = &pnextrframe->u.hdr.attrib; -if (SN_LESS (pnextattrib->seq_num, pattrib->seq_num)) - plist =get_next (plist); -else if (SN_EQUAL (pnextattrib->seq_num, pattrib->seq_num)) -/* Duplicate entry is found!! Do not insert current entry. */ -/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */ -return false; -else +if (!SN_LESS (pnextattrib->seq_num, pattrib->seq_num)) { +if (SN_EQUAL (pnextattrib->seq_num, pattrib->seq_num)) { +/* Duplicate entry is found!! Do not insert current entry. */ +/* spin_unlock_irqrestore(&ppending_recvframe_queue->lock, irql); */ +return false; + }break ; - } + } + plist =get_next (plist); + }/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */ /* spin_lock(&ppending_recvframe_queue->lock); */
Signature · 1 line
2.55.0
Greg KH
maintainerQuoted 4 lines · Hussien Sajjad Ali
The checkpatch.pl tool reports a warning for using an unnecessary else after a return statement. This patch refactors the while loop logic in
enqueue_reorder_recvframeto remove the unnecessary else block and improve code style.
If you look in the archives, you will see that this patch actually changes the logic here, right?
Be careful please.
thanks,
greg k-h