From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 F04AC301000 for ; Sat, 31 Jan 2026 22:10:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769897422; cv=none; b=SRzo/NIOByBAvZJdWmtBHbi0nUg/W2B++F1tKNYVd/riV0ahhajZTnTqI4MJ4fKHI3YylOoohMJQOGSz2CaIzGzYFlrzJB6JwEhtSPl9B27aRO1gxJmXtNuksv0Jr42TBWJMO7YVl16Nbtt7DOSD/m+V2QheVJLrBbWcOjH6H7U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769897422; c=relaxed/simple; bh=hXZNMmHvaM3/bJNv+N499aML1DIIKFxCtIUVStP8vHE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OeLRiLcx7crOdJViLegk8UYJ5763fubIHy3yldg2Kowar25fhuf15Uu0ENT1XsVnKZoN7GpuqBSDMZEj9k2ot371eUkGYs+0KegUT0v9kCu7TRDbpBYOKDynJfARbTcN0rnPYsQ5YC4a5Lg4tpGzK0GS8Bd8KzobR1bluEEATA4= 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=nVTltT1j; arc=none smtp.client-ip=209.85.160.171 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="nVTltT1j" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-5014e1312c6so20758131cf.2 for ; Sat, 31 Jan 2026 14:10:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769897420; x=1770502220; 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=O4e5J/AiG0+ew3WaOLmVTd+HTXzb2nikwAnJUxaUq6o=; b=nVTltT1jc9364gAXk24NVNXECDu7p9gLTX2Jy0EmnhSbEEO16+WH3l6plG81dddHSf I9p/9jQ7jYJodyt9vJ8oLUgVB23oh/SlXFCDqRbUQVO3W/5RykTV2L3qug6LE7ggi2r4 drdK3wxntMNHcCETWzhSrfrN09/i5de6BPV58PxForhj0q3oqelOo02yQnAdkObRPhAe NczvRhbVvJ2IpAd7vpggN54Lia0AmNEru4v8JB8nfUdyLAYMMNxe2pVBm02E//8lKVun T6vsQloK6G2zDxuuJn7pmu4HcA5RhVzNbsTV6PUBQg5WqkfrO62XB73ZUtjtEjabAPyb C9QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769897420; x=1770502220; 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=O4e5J/AiG0+ew3WaOLmVTd+HTXzb2nikwAnJUxaUq6o=; b=YJ80kCRB5JXwgwhk+XTS8ntroqyvmA7F0d3iwWRS2FpQsBj0YLmfVRB6SxfTozaKy5 6E1AqFARgCbm+6W6HgKKnHUsWemmFvCGo5OrGHsGexgObL0H/7JnS06r8giPsFvLLWlA Djd9qJfIbJYGcg6VcGQMtGYeTL6SV0zSjjGB935qfcMB6GDPZFMzkY/Myn4jnKscorCC V3lf+JWVVAt44YB+KodNgokTenVzJ9+T7f97WT3rVlU8GpBy0mIVcgnITJP8b4ajGAGE XRUnEANBoV9/xZEIC5yVnYeZMIPCfh03+4TxokLGwNLAA8J+V68g/TwILPlzgQMbRJ8Y vvCg== X-Forwarded-Encrypted: i=1; AJvYcCXgVp5BeyX9o56wu/YGMboxYOIZjplIvTbF68EmmRqW2JOu9auelt+GiCM6e9aRukJUItHaZeT3Qt8xzKA=@vger.kernel.org X-Gm-Message-State: AOJu0YwpZIXWCK63x+2yrZ04viJiKBAn+fl+aunkieD4V6Yccydn+uJQ XoMczv50A0c8bhiScUEn6fBtP2c8gGvrzO9DgY0sK16Zj1yscGAr7DKqekYmtw== X-Gm-Gg: AZuq6aJMexJXNTr2cJsmRzss4yS402oKkzxV3vXOEFMHBN3gAewHyr5f+mAen5C1nbc 9So2OhKt8/oR3lfDq0929UZiIl81Ohx0B76/09BHuL9DUSzdrvSxPMpvzZ6VnI4Ow9q9tiynUTx O9L7s9Wnso05+HuqY2PXABcWf4KObBk+QmOE81trRQ0J8Tqp3jGeB/5riPY64+yJ7Zn0m7BiODl GSKLZVuvGf0Eqm0F4wph1fRqc8RpqJFlb375Gr5YjSBfe/o5S7QWhLp3UxH/nXCg62i2tbx1ABe 0LWSIMHqVBwFbQjhGjSXVdlMGdGMEzrMxupxPzpgFUH1ryzhXDk17V1eAvnisZ6NCOnn5PgAa5j jc0jUn+CaWjErkga9xPpT9IKeRBj7brlWOS8iJdJuTU4z3DJZkCQYB14ADa87EltfAvebPbmqSz ftREOnW6PMNR/iZT29ayH2Xa2hBLvtyK0FV/0= X-Received: by 2002:ac8:5801:0:b0:501:4b67:1210 with SMTP id d75a77b69052e-505d2291118mr103070941cf.56.1769897419852; Sat, 31 Jan 2026 14:10:19 -0800 (PST) Received: from localhost ([132.216.195.165]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-5033745d7a9sm78278421cf.5.2026.01.31.14.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Jan 2026 14:10:19 -0800 (PST) Date: Sat, 31 Jan 2026 17:10:18 -0500 From: William Hansen-Baird To: Greg KH Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 5/5] staging: rtl8723bs: core/rtw_mlme_ext.c: initialize copy_len, clearing later control-flow. Message-ID: References: <20260116160914.88069-1-william.hansen.baird@gmail.com> <20260116160914.88069-5-william.hansen.baird@gmail.com> <2026012720-ending-obsessive-3555@gregkh> 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: <2026012720-ending-obsessive-3555@gregkh> On Tue, Jan 27, 2026 at 03:38:29PM +0100, Greg KH wrote: > On Fri, Jan 16, 2026 at 11:08:51AM -0500, William Hansen-Baird wrote: > > Initialize copy_len to 0 in rtw_parse_assoc_security_ies function. > > This allows later if-statement to not have to explicitly set copy_len to 0. > > Thus we can make the if statement single-lined, and remove the braces > > from the if-else branch. > > The change is purely cosmetic and changes no logic. > > > > Signed-off-by: William Hansen-Baird > > --- > > drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 9 ++++----- > > 1 file changed, 4 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > > index 842e95e1eaec..d470725a033f 100644 > > --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c > > @@ -946,6 +946,7 @@ static unsigned short rtw_parse_assoc_security_ies(struct adapter *padapter, > > pstat->wpa_pairwise_cipher = 0; > > pstat->wpa2_pairwise_cipher = 0; > > memset(pstat->wpa_ie, 0, sizeof(pstat->wpa_ie)); > > + > > if ((psecuritypriv->wpa_psk & BIT(1)) && elems->rsn_ie) { > > > > int group_cipher = 0, pairwise_cipher = 0; > > Why this line added? > > > @@ -1016,17 +1017,15 @@ static unsigned short rtw_parse_assoc_security_ies(struct adapter *padapter, > > } > > > > } else { > > - int copy_len; > > + int copy_len = 0; > > > > if (psecuritypriv->wpa_psk == 0) > > return WLAN_STATUS_INVALID_IE; > > > > - if (elems->wps_ie) { > > + if (elems->wps_ie) > > pstat->flags |= WLAN_STA_WPS; > > - copy_len = 0; > > - } else { > > + else > > copy_len = min_t(int, sizeof(pstat->wpa_ie), wpa_ie_len+2); > > - } > > > > if (copy_len > 0) > > memcpy(pstat->wpa_ie, wpa_ie-2, copy_len); > > I feel like this is just polishing the code for no reason at all. Why > make this change at all? What asked for it? > The change was really only polishing. There wasn't an issue to solve and it was mainly a stylistic choice on my part. If you prefer, I can drop this patch and keep the original style. Thanks, William