mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: William Hansen-Baird <william.hansen.baird@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	William Hansen-Baird <william.hansen.baird@gmail.com>
Subject: [PATCH 2/2] staging: rtl8723bs: core/rtw_mlme_ext.c: flatten indentation with early loop continue in OnAssocReq()
Date: Tue, 13 Jan 2026 16:14:33 -0500	[thread overview]
Message-ID: <20260113211433.89512-2-william.hansen.baird@gmail.com> (raw)
In-Reply-To: <20260113211433.89512-1-william.hansen.baird@gmail.com>

Replace large if (memcmp(p+2, WMM_IE, 6)) inside the for (;;) loop,
which ends with a break, with an early continue.
This reduces deep nesting and is purely stylistic.

Signed-off-by: William Hansen-Baird <william.hansen.baird@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 61 ++++++++++---------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
index d3b395894d4b..4eb28577fb6a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c
@@ -1184,46 +1184,47 @@ unsigned int OnAssocReq(struct adapter *padapter, union recv_frame *precv_frame)
 			if (!p)
 				break;
 
-			if (!memcmp(p+2, WMM_IE, 6)) {
+			if (memcmp(p+2, WMM_IE, 6)) {
+				p = p + ie_len + 2;
+				continue;
+			}
 
-				pstat->flags |= WLAN_STA_WME;
+			pstat->flags |= WLAN_STA_WME;
 
-				pstat->qos_option = 1;
-				pstat->qos_info = *(p+8);
+			pstat->qos_option = 1;
+			pstat->qos_info = *(p+8);
 
-				pstat->max_sp_len = (pstat->qos_info>>5)&0x3;
+			pstat->max_sp_len = (pstat->qos_info>>5)&0x3;
 
-				if ((pstat->qos_info&0xf) != 0xf)
-					pstat->has_legacy_ac = true;
-				else
-					pstat->has_legacy_ac = false;
-
-				if (pstat->qos_info&0xf) {
-					if (pstat->qos_info&BIT(0))
-						pstat->uapsd_vo = BIT(0)|BIT(1);
-					else
-						pstat->uapsd_vo = 0;
+			if ((pstat->qos_info&0xf) != 0xf)
+				pstat->has_legacy_ac = true;
+			else
+				pstat->has_legacy_ac = false;
 
-					if (pstat->qos_info&BIT(1))
-						pstat->uapsd_vi = BIT(0)|BIT(1);
-					else
-						pstat->uapsd_vi = 0;
+			if (pstat->qos_info&0xf) {
+				if (pstat->qos_info&BIT(0))
+					pstat->uapsd_vo = BIT(0)|BIT(1);
+				else
+					pstat->uapsd_vo = 0;
 
-					if (pstat->qos_info&BIT(2))
-						pstat->uapsd_bk = BIT(0)|BIT(1);
-					else
-						pstat->uapsd_bk = 0;
+				if (pstat->qos_info&BIT(1))
+					pstat->uapsd_vi = BIT(0)|BIT(1);
+				else
+					pstat->uapsd_vi = 0;
 
-					if (pstat->qos_info&BIT(3))
-						pstat->uapsd_be = BIT(0)|BIT(1);
-					else
-						pstat->uapsd_be = 0;
+				if (pstat->qos_info&BIT(2))
+					pstat->uapsd_bk = BIT(0)|BIT(1);
+				else
+					pstat->uapsd_bk = 0;
 
-				}
+				if (pstat->qos_info&BIT(3))
+					pstat->uapsd_be = BIT(0)|BIT(1);
+				else
+					pstat->uapsd_be = 0;
 
-				break;
 			}
-			p = p + ie_len + 2;
+
+			break;
 		}
 	}
 
-- 
2.52.0


  reply	other threads:[~2026-01-13 21:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-13 21:14 [PATCH 1/2] staging: rtl8723bs: core/rtw_mlme_ext.c: flatten control flow " William Hansen-Baird
2026-01-13 21:14 ` William Hansen-Baird [this message]
2026-01-16 13:06   ` [PATCH 2/2] staging: rtl8723bs: core/rtw_mlme_ext.c: flatten indentation with early loop continue " Greg KH
2026-01-16 13:05 ` [PATCH 1/2] staging: rtl8723bs: core/rtw_mlme_ext.c: flatten control flow " Greg KH

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=20260113211433.89512-2-william.hansen.baird@gmail.com \
    --to=william.hansen.baird@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®