Skip to contentSkip to conversation

staging: rtl8723bs: remove else after return in enqueue_reorder_recvframe

PATCH In review Aditya Tipre 2 participants 2 messages Jul 9 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: remove else after return in enqueue_reorder_recvframe

The duplicate-frame path returns immediately, so the following else is unnecessary. Use continue while walking the reorder queue and fall through to break once the insertion point is found.

---
 drivers/staging/rtl8723bs/core/rtw_recv.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/staging/rtl8723bs/core/rtw_recv.c +7 -4
index 86c5e2c4e7dd..c97c5fb73bb7 100644
@@ -1783,14 +1783,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))
+		if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) {
 			plist = get_next(plist);
-		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
+			continue;
+		}
+
+		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
-			break;
+
+		break;
 	}
 
 	/* spin_lock_irqsave(&ppending_recvframe_queue->lock, irql); */
Signature · 1 line
2.54.0
#1 lore raw
Quoted 2 lines · Aditya Tipre

The duplicate-frame path returns immediately, so the following else is unnecessary.

What? Also no. It's necessary. Checkpatch is just a simple perl script. Use this as an opportunity to learn to be critical of your tools. ;)

regards,
dan carpenter