From nobody Mon Feb 9 07:22:02 2026 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 476D71946DA for ; Fri, 23 Jan 2026 21:19:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769203165; cv=none; b=vFjJpNs9p46WfypcSzYgJsFxxTe60JtuieIBzqLsCJ43Q9c0Is4ZYOlJkkcNqU/EWoT3l8WmREXb1LRk6Kgt5N9sSE93PopF/evUQNv7quyrE9Pf/K1Suq0y7mqHw6+gEDxKQI/UW07Yiqwc4fgK6yjWD2AM5uGiO5hQrTYDpoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769203165; c=relaxed/simple; bh=B7lauwC0PhR2Uq6+Y6qtpT1Aei1c7wc9xs9GdTm2JTE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lys4bgnEelxZcTy48cnQgsMQ1IHFbwYbwMlLT8U3k2bOemHsUqsVZCJWJkXkYdJMHfmWmyjj6aMy9aJdlJN9RVYlH1thd2VhVarxWyrVpAxz33aPNPfbC6/llVVzhzq+knb4QXS5lAJB7Otog6rUCtH43tCDOaS6GcvPsMaNrPc= 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=J1mbXiXK; arc=none smtp.client-ip=209.85.210.179 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="J1mbXiXK" Received: by mail-pf1-f179.google.com with SMTP id d2e1a72fcca58-81f4e136481so1431305b3a.3 for ; Fri, 23 Jan 2026 13:19:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769203164; x=1769807964; 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=l7+gptmUu1WgROnTfKUbDotrrabbU+mDCS1QhaivmYM=; b=J1mbXiXKAbzrn90p8sBPGir3QVHD2k2yX3kBty7q/hljtN6R2hXQdQ30UcIKC7vTn1 osYg4KE5QcT3jmSaO9FKBErUlB38XtkM4DdNfxPfdvNdp3PF9XpROytqXAUDnMonSAvL LkSJj4i0otYMhrsOeoZaL1NoooQVWLufj9EOPtDKDW6pE8LAWdpxSFJSgulZ9Ab90ba8 bEneUb8MefxN4FDMyEzb9m4Ilnztp56hhYu8Cq+DzSpo5auYgypuxZ+Q8wIZ6ndAftWo ltQeOiexd2Bg+0F05sR6/XFF/3BJaLFj2PNZgpLvHlmR9E+GDupyY31/QoSgaoah01Ew v8MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769203164; x=1769807964; 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=l7+gptmUu1WgROnTfKUbDotrrabbU+mDCS1QhaivmYM=; b=qpw5JXE4Sv2Whh/Ubsj0HfsV9BXqlqLKTf3gYJGaa9nmsbvlzKPXutpKKnHP2Hs5e+ 4q4CS9WLqlq8s1FqMh+OKi88tFiPE6pCWWFoe2xhfcnpqFrwzZ6rhEep9h3IrZSNVfx+ yAXW5F0nh34MolUQYta4hdJRZD9tyNEmmd7xiQnYvLxg1lyj9EgVnnupnAQy/pzfoWhW hXTYXmde6eAwhzmpKBiBm1Dqu56gmb7jr4S40QMVz37DHq8KFo0p9IVn4H9XjAkSMm8l s37xvzkmwe1AfFdnE7VY+8umLWja3S90p/cWCUDlUcmQgiBwFrlzlFoJ87oSFGjpjvy2 qmWQ== X-Forwarded-Encrypted: i=1; AJvYcCXNNd7sLhvlnPLv4jUvDr35GnuwGUnf5N60DtZOgi+uY/gUmO4RPWLC3jT05BxhO65AykSvIJ+FjQZxtyQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxZdzvkC4Ctn4FtWeFIKIqLPCpX98pofdb05o+MMRWrQdAiKER9 6zBA84EzDl8bvatQStoCaMbnffl4P5R3xfGUnH28qmiCs9YkfdX0NO8SFVfXPLtI X-Gm-Gg: AZuq6aIq4UL6nnQ2gWRUsqqt1zLCfEVy6KSDtrI9Rn6REHaZRdlIzwmkdANUoMO61Xs 0C2xJiYm4ofBAFTRD1sY1+4+SiStSfUA8laU/QbiA8IO2y5AA548zHHigN+DBIS905hzzTgqygs DSpf0xKKUMzVULNLCNbdijdgTeT7yCdYBp45mZUc0pzUjyCDPCILN+gLAd5gjwxfBz7CZvtBbpk fmaOVlLyfekEdyBkyW5WTWymRcYfy7NkuVVercQacZFrFgcMOZzklX2pkkplhXuSymUIkMBtG6N cGOygj4bEKxWUPP8S6nepoROLaf/rqzFw101T2JrfE74rmH79a3iu4StyokI+2PuA3G2HSpX92Y K32wlPy2ZxKsVhq30HxhQN4GILLhwyuWaHwuOv5clRXTucqTaEvuN9ikbi3j2p4P6CgyYKF4DQX 2F8Wpj3Kcd7S2/hslMueFKJx48fcikM2JX X-Received: by 2002:a05:6a21:6487:b0:366:14b0:4b04 with SMTP id adf61e73a8af0-38e6f823d1emr4090800637.64.1769203163592; Fri, 23 Jan 2026 13:19:23 -0800 (PST) Received: from tehuang-Alienware-m16-R2.. ([50.47.240.160]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-c635a141fc4sm2779469a12.8.2026.01.23.13.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jan 2026 13:19:23 -0800 (PST) From: Michael Huang To: Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Huang Subject: [PATCH v3 1/2] staging: rtl8723bs: refactor nested loops to reduce indentation Date: Fri, 23 Jan 2026 13:19:03 -0800 Message-ID: <20260123211904.64589-2-tehsiu.huang@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260123211904.64589-1-tehsiu.huang@gmail.com> References: <20260123211904.64589-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 --- 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) =20 spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); =20 - for (i =3D 0; i < 8; i++) { - if (ICS[i][0] =3D=3D 1) { - int j, k =3D 0; + int j, k =3D 0; =20 - InfoContent[k] =3D i; - /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */ - k++; + if (ICS[i][0] !=3D 1) + continue; =20 - 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++; =20 - 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; =20 + if (k < 16) { + InfoContent[k] =3D j; /* channel number */ + /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */ + k++; + } } =20 + pframe =3D rtw_set_ie(pframe, + WLAN_EID_BSS_INTOLERANT_CHL_REPORT, + k, InfoContent, &pattrib->pktlen); } - - } =20 =20 @@ -3831,14 +3830,24 @@ void site_survey(struct adapter *padapter) int i; =20 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); } =20 if (pmlmeext->sitesurvey_res.scan_mode =3D=3D SCAN_ACTIVE) { --=20 2.43.0