From nobody Sun Feb 8 20:00:10 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B00B2D0C84 for ; Sat, 24 Jan 2026 10:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769251930; cv=none; b=oimIWyZN8NQlNCVQd0/IfJN5ikowKSegjtsez5hT0iWOIZkUOW9CcyOftx/l6psPznVsyWJ7497rYYcBQYzo2CXc0QCBLGmuV4SFKyKVtmEGwrvr3HWBrMp4wNFZKP5LWxuh1RgiyuCouGTK0G1GOc6439OX5mPTEYfmZyvr8CI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769251930; c=relaxed/simple; bh=NAhV+EGTrg4zqg2uM5ltnaeo9F7X2r3mhXGdV/D5phw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hdk/2nRtWsDqvUasSowr+1bl0dkZ7i7hmifsulc9e2A2yFWCMdmXJf3pQBTV7nVT5PUJ8wfNHWD57h2NARNaH36Biz4uFO+zmhxv+8I5NgqKfI2SQCj7Z/McbuNlUblbHJZ65R+32MREcmhdSYtpj3//RO9GrsurbsoQKTUH33o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=csmmnHdO; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="csmmnHdO" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2a7786d7895so19957025ad.1 for ; Sat, 24 Jan 2026 02:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769251929; x=1769856729; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=97+wvAR7vSL2hQOkz8tJI+iHkohzQNf97h734mRTrKo=; b=csmmnHdOQL5dLxOzruKH6PlgPpuuNQi14odwwJtQg+5Y9f21W8VBdSDLmF8y88BDM1 y86cbv72e2YYHMY1rgjyoUWfd+yEpJmT0WAVsBlH4ccXXWw7RkRwtzjIK+3iZWqx8Yva P0iOtttau6wyYGLUbiY7/W0NOJveGF9S3EssntSOml9V5suoWAtpNQoGd8TG3gh+UILP QdNghYe6JnESZrJijAaYmbKUGyIxmajzfZTrBZhO8XmCP09ErtDZdfy6nfRHlMq0y6aP HAZ2ABs3M19cnXpj832uLNboBX+z/DB8VUE9EXqTkAmKUZK6WQgon3Creav9IwrrVZK+ Lifw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769251929; x=1769856729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=97+wvAR7vSL2hQOkz8tJI+iHkohzQNf97h734mRTrKo=; b=xVVkc01Rx2BdpATOGdEGD73xG3fF1ekNFRJyUKTxmkzODQUIHu4bqcXAp3LSdqyauS uV7iAvS6Ptxw7DBAhFCBV/ZebrWVlusEhaL1Xv/TBuyClRpDnipXDsrKNG7NCVWfFA1X 2IpCmVcNL/oVLQsdlh+fl7MWaTNBzrR276lL4O3WVsoEe2hSilLy/hyOXbQau4UqJENn rDOttGqZoAjslvaaavW87XWI+AHkUUwFJov5GGtXmb+13Y4VXRVUSdXfo31JmJvlEVnC e3sjLmPlMxhsUhruoKAORPzOqTs16wfqs6oJdei2SHhfu5AES6U57LpEGiksJlcNXJLk rZ0A== X-Forwarded-Encrypted: i=1; AJvYcCV0lJbJmRo6VZV6iVHiKfbaTzdyxy2uOmjVGkXUmgj8Aq8b7i+M+1MUeAFYAo07OSjq25Yh2kd6aLOgizo=@vger.kernel.org X-Gm-Message-State: AOJu0YyzNdhCXwZseDWPSluQkMj5sm9Jc+2SNHBH6cHq8oIGvXVMCnit jM8kYDZaGn+mawCYXfILF7gI5jmQsrQ36Wp08UAGcHrNDlEJ/cMcDp8EeNSLSg== X-Gm-Gg: AZuq6aJDmbG9aRn68qpSDFdoiH0lkEX1W+UoAez3b+y2koGG6/ysx1IW7uwUYVhj0Ks 9j9+ozdsmreiI22sxIwmEVBC7ot+Oyy5EpZ7w9TEv3TnIKpljo1MM/iHa3xVDokUzSrS1iSU5eD iqeMbVpTtl5jdDzuzdWrVcOaYi4TwPpjTw50cWXKZtMgxJKP7jZ5xB0oB8MmL7cOPTP5hyD3hpK t57jOvWW3+paxXBqtNme1INIML0ktFMTy7hdNQOn7dFCoiEN+WWBxABkZkAOcQyhqSlVzaKdcb/ 6D5XQt9ZkbiBEXSswimq6fHpmr+a+52waPi4xM2/NnbhKIEXBUG3IlvGPD77rJTwMKmx+83qeU/ qKbEv2oPJuUDp4mEjhPNsLRVfhAmCf7oNtCMDjeuL3D80q/xI0C7lBBrRSnnlOI9BGo/IGB3gIB lQC7bNPTGUR6dyAOS3Zrp85K0ZwaEzp5j2 X-Received: by 2002:a17:903:2351:b0:2a7:88d2:dd9d with SMTP id d9443c01a7336-2a7fe625dc0mr58381945ad.31.1769251928706; Sat, 24 Jan 2026 02:52:08 -0800 (PST) Received: from tehuang-Alienware-m16-R2.. ([50.47.240.160]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802de5cd4sm42468985ad.40.2026.01.24.02.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jan 2026 02:52:08 -0800 (PST) From: Michael Huang To: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Huang Subject: [PATCH v4 1/2] staging: rtl8723bs: refactor nested loops to reduce indentation Date: Sat, 24 Jan 2026 02:49:19 -0800 Message-ID: <20260124104920.5721-2-tehsiu.huang@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260124104920.5721-1-tehsiu.huang@gmail.com> References: <20260123211904.64589-1-tehsiu.huang@gmail.com> <20260124104920.5721-1-tehsiu.huang@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use guard clauses (continue statements) to flatten the logic in rtw_mlme_ext.c. This improves code readability by reducing deep nesting levels. Signed-off-by: Michael Huang --- Changes in v4: - Fix canonical patch format by moving the changelog below the "---" line. - Initial public submission (corrected versioning). Changes in v3: - Fix line wrapping in commit description (under 75 chars). - Properly align multi-line function parameters. - Remove unnecessary parentheses. - Add missing Signed-off-by tag. drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 61 +++++++++++-------- 1 file changed, 35 insertions(+), 26 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/stagin= g/rtl8723bs/core/rtw_mlme_ext.c index fa1e3ad59254..0ab3629608ce 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -3682,32 +3682,31 @@ static void issue_action_BSSCoexistPacket(struct ad= apter *padapter) spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); - for (i =3D 0; i < 8; i++) { - if (ICS[i][0] =3D=3D 1) { - int j, k =3D 0; + int j, k =3D 0; - InfoContent[k] =3D i; - /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */ - k++; + if (ICS[i][0] !=3D 1) + continue; - for (j =3D 1; j <=3D 14; j++) { - if (ICS[i][j] =3D=3D 1) { - if (k < 16) { - InfoContent[k] =3D j; /* channel number */ - /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */ - k++; - } - } - } + InfoContent[k] =3D i; + /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */ + k++; - pframe =3D rtw_set_ie(pframe, WLAN_EID_BSS_INTOLERANT_CHL_REPORT, k, I= nfoContent, &(pattrib->pktlen)); + for (j =3D 1; j <=3D 14; j++) { + if (ICS[i][j] !=3D 1) + continue; + if (k < 16) { + InfoContent[k] =3D j; /* channel number */ + /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */ + k++; + } } + pframe =3D rtw_set_ie(pframe, + WLAN_EID_BSS_INTOLERANT_CHL_REPORT, + k, InfoContent, &pattrib->pktlen); } - - } @@ -3831,14 +3830,24 @@ void site_survey(struct adapter *padapter) int i; for (i =3D 0; i < RTW_SSID_SCAN_AMOUNT; i++) { - if (pmlmeext->sitesurvey_res.ssid[i].ssid_length) { - /* IOT issue, When wifi_spec is not set, send one probe req without = WPS IE. */ - if (padapter->registrypriv.wifi_spec) - issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); - else - issue_probereq_ex(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NU= LL, 0, 0, 0, 0); - issue_probereq(padapter, &(pmlmeext->sitesurvey_res.ssid[i]), NULL); - } + if (!pmlmeext->sitesurvey_res.ssid[i].ssid_length) + continue; + + /* IOT issue, When wifi_spec is not set. */ + /* Send one probe req without WPS IE. */ + if (padapter->registrypriv.wifi_spec) + issue_probereq(padapter, + &pmlmeext->sitesurvey_res.ssid[i], + NULL); + else + issue_probereq_ex(padapter, + &pmlmeext->sitesurvey_res.ssid[i], + NULL, + 0, 0, 0, 0); + + issue_probereq(padapter, + &pmlmeext->sitesurvey_res.ssid[i], + NULL); } if (pmlmeext->sitesurvey_res.scan_mode =3D=3D SCAN_ACTIVE) { -- 2.43.0