Skip to contentSkip to conversation

staging: rtl8723bs: remove unnecessary else after break/return

PATCH In review ColtenOuO 2 participants 2 messages Jul 21 – Jul 23 Staging

lore
Share & tools
lore

ColtenOuO

author
#0 lore raw

PATCH 1/1 staging: rtl8723bs: remove unnecessary else after break/return

checkpatch.pl flags an else clause following a branch that already returns, in enqueue_reorder_recvframe(). Restructure the if/else-if/else chain into sequential checks to remove the redundant else, with no change in behavior.

---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/staging/rtl8723bs/core/rtw_recv.c +3 -5
index 86c5e2c4e7dd..79bd56a5d6cd 100644
@@ -1783,14 +1783,12 @@ 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))
+		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))
 			break;
+		plist = get_next(plist);
 	}
 
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · ColtenOuO

checkpatch.pl flags an else clause following a branch that already returns, in enqueue_reorder_recvframe(). Restructure the if/else-if/else chain into sequential checks to remove the redundant else, with no change in behavior.

That's not the name you use to sign legal documents.

But really, the original code is fine, just ignore tools when they are wrong.

regards,
dan carpenter