public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RESEND PATCH] staging: rtl8188eu: Fix else after return WARNING (checkpatch)
@ 2020-09-13  6:49 Sohom Datta
  2020-09-13  6:52 ` Greg Kroah-Hartman
  2020-09-14 14:57 ` Dan Carpenter
  0 siblings, 2 replies; 6+ messages in thread
From: Sohom Datta @ 2020-09-13  6:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Larry Finger, devel, linux-kernel

From 4c8c8f3ff7f4d711daea4ac3bb987fcecc7ef1ed Mon Sep 17 00:00:00 2001
From: Sohom <sohom.datta@learner.manipal.edu>
Date: Sat, 12 Sep 2020 18:04:56 +0530
Subject: [RESEND PATCH] staging: rtl8188eu: Fix else after return WARNING
 (checkpatch)

Fixed:
WARNING: else is not generally useful after a break or return
1636: FILE: ./rtw_recv.c:1636:
+           return false;
+       else

Separated the return statement into a separate block since
it doesn't seem to depend on the SN_LESS explicity being false.

Signed-off-by: Sohom <sohom.datta@learner.manipal.edu>
---
 drivers/staging/rtl8188eu/core/rtw_recv.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index 5fe7a0458dd2..5e81134ffb6d 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1629,10 +1629,11 @@ static int enqueue_reorder_recvframe(struct recv_reorder_ctrl *preorder_ctrl,
 		hdr = list_entry(plist, struct recv_frame, list);
 		pnextattrib = &hdr->attrib;
 
+		if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
+			return false;
+
 		if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
 			plist = plist->next;
-		else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
-			return false;
 		else
 			break;
 	}
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-09-15 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-13  6:49 [RESEND PATCH] staging: rtl8188eu: Fix else after return WARNING (checkpatch) Sohom Datta
2020-09-13  6:52 ` Greg Kroah-Hartman
2020-09-14 14:57 ` Dan Carpenter
2020-09-14 16:42   ` Joe Perches
2020-09-15 11:20     ` Dan Carpenter
2020-09-15 15:25       ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox