From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 A3F4B2D5925 for ; Sat, 24 Jan 2026 10:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769252374; cv=none; b=ETDxxOawp0PxxTBSHuOooU2Ad4BJ2icfqLdn3ZXlcpSn85RTf6hshceVIervM5mz0cdYs3YDvlwpom15Iwml1lwofyzTVacWLk4oZN5/Dm/b6xG29T5mfsWbnf1wYFJNN+cddzLiVmevFzJNxW/LsioeFgSdLIo3YpVwWQkNtGo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769252374; c=relaxed/simple; bh=HAjlA3sVwH6RJivhrDnrkgScIV06eagiHw7wFOgGjjE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=N7y+CaTk+wKlSGPbpbhsdx7hR1JHaEZEoXDwjKAm8ZHVniQt6Jgy2a/s+M0vQoEgasunEKZ0PBcoxD/Cq8UDf7vajdyv70EmPbyHWIKw6w1Rgh6moMsRvd6W8AqlUr+V3In0BFnS4AgrC3aqkx4dPP1aIcDuGNqYAIz9zq0pcgc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZoLZVVY6; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZoLZVVY6" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-47ee76e8656so42240295e9.0 for ; Sat, 24 Jan 2026 02:59:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1769252370; x=1769857170; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Y6j/ehzxX1qT5ApFk2lWpVx3Wy/WtH9IgjQk1wTA1os=; b=ZoLZVVY6+FBdKtqmrlVMjfrJQku2fktIcIu1ysVvtRWRo/2QWJn/8D2k7gdbvkdTfj r/bYavAWpLcA0ME3avaoYS32hKUG4gTzV9SR4XqWFp1WV7aUkHAiQdXpQxybqOH+16UN DsAkMlAfo87yxr1gctW1LjFvjeoZgFx9Ikn8tNF+E318SRxKKxjybKUQxL+tnTZNSY8P ieik6oNU6f3srtoyxuTDUzGtmcUIRltsoHal+jqVlQTFfSbqLYtNjCCIt5e3QslI7I+j CET8hI3t7yqntIiP3AMZhQxqrjNuHTnzNmi7KuMuZKoxIk6mjc5t8iBa/8aZbxwxifeA Omww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769252370; x=1769857170; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y6j/ehzxX1qT5ApFk2lWpVx3Wy/WtH9IgjQk1wTA1os=; b=U/hFEbY7X/MperdPPx6WR2UzK+NFwtUlOY2Pd+B+Ndzz0kjILPzaUIcZh4CEK+eO3i cyqSZ3vrax3DKQsE7GbRc83+Fe8EqxLqaoZmgdGdN/+flrdWE9mYat2O7SZ6aKqXT9fy mHptjVSTWW1qJpNzxdDlKPSXXP0F0rcFtJQKWMAEOaDA9oWT5l8nNxHZsCdmaBOn7NqO QdEbLSvdi9UGLL2azgsmTsmIv8c1xJnM3G1f6RLddoDrxmv/rwRZ9NIVMUNZ3IwxrmGy rMr0WYE9MPosi8eWgWYkbPQdHda9fJEaOcbidKjogpRC15ZyjJ8hosc9y1/gWxnHpr03 nofA== X-Forwarded-Encrypted: i=1; AJvYcCXM/oPGQmibcghH7CnPCoDQ0/aJcVyx/S7ttFqEoKGxUbOq4Ah3lrdlK4EvfYd4Pey4ELuUrJVogHBGcHA=@vger.kernel.org X-Gm-Message-State: AOJu0Ywe92AoyWX4rR4MwY/yETeJGCfu4DGJqgDr5mOMRTZ8qIGEyBMq mJxc9GrciXNoixSrxa4zA17bsW2JFI8edPzrkhl6ZoKtmw2LqXjw0eMywpDAZ7CGKFU= X-Gm-Gg: AZuq6aIPJMfyx86WAQfXSVUcvJKQQoMOUpkguAZV9taK6TJLeikfcU0g0UkfqK5RJE/ 3yWhDW1rsTnxdDV7ZRpKqyFeBaTTEgySJOn8/MBPqIP9NEsAmEsxsTAzYbTNpCQtQhUByHz/XaO TnXbTbKI+0of1hik+BKQWL81Uyvd9Ee1j5mXcl7bealvP7ZLcYnD6LGW60eowqUb+rMlTmWTO/D T3pbnIRqsbZyG+nqplerLFY4wOsB1eQNgx2qCd4Hy7iQnHIvFF2xx59SslB/g/5bWMDHbOcHT6i KcovmdgS3rFpk3FrMickZyK+SLYFCMMFNtFdauLoB0c2RPxs00iw0mBa0KOPhZRMXxzEFYVjqFe AgTfY7kSHaOz6tAPRsY4ZxzsaxBWPTgxJsgVQsvveQAYjtEjkdIb8cB7VHG/8cqv8zAkWUHvbOq MDhlX0g3pnsq51zbrY X-Received: by 2002:a05:600c:8283:b0:47f:b737:5ce0 with SMTP id 5b1f17b1804b1-4804c9b4cb3mr100540105e9.23.1769252369750; Sat, 24 Jan 2026 02:59:29 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4804d8b4fc3sm118211055e9.13.2026.01.24.02.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Jan 2026 02:59:29 -0800 (PST) Date: Sat, 24 Jan 2026 13:59:26 +0300 From: Dan Carpenter To: Michael Huang Cc: Greg Kroah-Hartman , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] staging: rtl8723bs: refactor nested loops to reduce indentation Message-ID: References: <20260123211904.64589-1-tehsiu.huang@gmail.com> <20260123211904.64589-2-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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260123211904.64589-2-tehsiu.huang@gmail.com> On Fri, Jan 23, 2026 at 01:19:03PM -0800, Michael Huang wrote: > Use guard clauses (continue statements) to flatten the logic in Just say continue statements. I saw "Use guard" and thought you were going to use "guard statements" which is a different thing in the kernel. > 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/staging/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 adapter *padapter) > > spin_unlock_bh(&(pmlmepriv->scanned_queue.lock)); > > - > for (i = 0; i < 8; i++) { > - if (ICS[i][0] == 1) { > - int j, k = 0; > + int j, k = 0; > > - InfoContent[k] = i; > - /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */ > - k++; > + if (ICS[i][0] != 1) > + continue; > > - for (j = 1; j <= 14; j++) { > - if (ICS[i][j] == 1) { > - if (k < 16) { > - InfoContent[k] = j; /* channel number */ > - /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */ > - k++; > - } > - } > - } > + InfoContent[k] = i; > + /* SET_BSS_INTOLERANT_ELE_REG_CLASS(InfoContent, i); */ > + k++; > > - pframe = rtw_set_ie(pframe, WLAN_EID_BSS_INTOLERANT_CHL_REPORT, k, InfoContent, &(pattrib->pktlen)); > + for (j = 1; j <= 14; j++) { > + if (ICS[i][j] != 1) > + continue; > > + if (k < 16) { > + InfoContent[k] = j; /* channel number */ > + /* SET_BSS_INTOLERANT_ELE_CHANNEL(InfoContent+k, j); */ > + k++; > + } > } > > + pframe = rtw_set_ie(pframe, > + WLAN_EID_BSS_INTOLERANT_CHL_REPORT, > + k, InfoContent, &pattrib->pktlen); This is unrelated. Do it in a separate patch. > } > - > - > } > > > @@ -3831,14 +3830,24 @@ void site_survey(struct adapter *padapter) > int i; > > for (i = 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]), NULL, 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. */ You can flip the conditions around without rephrasing the comments. Do that in a separate patch. > + if (padapter->registrypriv.wifi_spec) > + issue_probereq(padapter, > + &pmlmeext->sitesurvey_res.ssid[i], > + NULL); All these reformating and removing extra parens makes the patch harder to review. I understand that checkpatch complains if you don't do it, but it's unrelated to the change you are making so it needs to be done in a separate step. (I'm not your boss and I can't tell you what to do. If you don't want to do the second step you can also skip it. The point is don't do unrelated things in the same patch). regards, dan carpenter