From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 4309F1DAC83 for ; Mon, 6 Jan 2025 10:32:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736159563; cv=none; b=jp9LteuvSPp7n1nWmq5B3UlLwGOhCEPe4a5XMr0sM7RMn8Ls2HfEW3QxfvVqAvJVvyxG5Qus1z71n0SFzAvCrrv1a9Fxf/uqUQRfWqRCD7UiJ0KJzadb1cpdTplmLzIzAIsbLVY3hqVJjy8fFmtw2rEsUZwUXR2ynUco0NvGOT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736159563; c=relaxed/simple; bh=HXMSDbasNbPdJOOO91H0ouSk4wRl+RFFGF+4VQfRjQc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MaprwTKY4UJI1zLlD0nKShVbiiCpTPR4zLCL31WDG2CYkc/jXk+tWnXYM+TMcgpGMIpbu5o7376Jd2qDQH9E4vxw5U7UohgNwmmHIiGWEIRJ1ywvQoT9O+UtdpF6g/BRfxSwvVYsqSwzTPbSyXSU3w7eV3arWstth0kLvJ+wnjE= 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=dkwHBZfC; arc=none smtp.client-ip=209.85.128.51 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="dkwHBZfC" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-43618283d48so102541715e9.1 for ; Mon, 06 Jan 2025 02:32:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736159559; x=1736764359; 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=GH7hQT9jqMX1zVTGHAF/1/kQ0oSFq2NbxlUNFuaETgk=; b=dkwHBZfCgoaqWzEdcbvgh3JUQfZ2Y4qStPMoSkJDsJKWVRg4orTu9LM6CUe3IyXy+X FFDpVyVhE3kqfbH3nU35xx+HWl/4VGi/Xd6akG/WkspCEp5DLt5qKRT/3Vsif38Ib9Or l3x/6vHWykHwbnfu3voOhSWjyA7ZUSMPjOzjM8fiJQPeYb/NK9n+/WkEWIDQgZ5Norqn PLnP3lRdoqpSgZq5H+VWTn1rAjbTq/0er8S8wbaE5kbvH0iw8+oVFHtHv24G0Or5EcAc L6xuu9yM8e5jl6w6FVRD7cisKvCZPN2mpVHMv8oX4rzkCprUD6tvLoKvJPcVQXXNiqzR Vo2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736159559; x=1736764359; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=GH7hQT9jqMX1zVTGHAF/1/kQ0oSFq2NbxlUNFuaETgk=; b=hkgOftOSmiPmpTzrTHLEvbll0kfJ66mUjyZeN/LKXaAQCmDHUHq2F8PMIotmW9a8Fb 1RXFTrqLU5NcsRC/fjVIHLWZSwzlDlFJOSIC0jXdVefjRU2LW6KcjobgwhPJJ67qLyC1 LUHl+3jdLlOiTFNBhokqNRwZULCOWsyl72TRSAGd85UXdRzbJkkVZ235U+lfD6wj8qrJ hpuO204CKBjlUaqdlEp4aFV0thr/Pjn1dNzQB9ss13HBOWqjwhZDe7zhPx2NRv7OFqJN h0PalxOQ9bBtx1stJR6i6nFrPXi7R+6wZnnlelnwSZ38clSQ5aWP8rBsDdCEGwUI+cWa CU0Q== X-Forwarded-Encrypted: i=1; AJvYcCW+UJWB7LEaPD/G/S+dee9RinWxbtef1vnH61fWgDIQPoXoUwDRBfU9DQCkrGSIZdMndV0RK1lfQ8IEMAM=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0AYjO352SmtqXwTfF731zTQJKY97OEcswjZHV4QA0BVWuDO3N 4GdT0Zs6qiZnxwKGF64jqnjKFUohz/4F+mdixnjrcG2bTChk+y+jw1qrgVEtu1w= X-Gm-Gg: ASbGncuwu0gXTwSDMSVf2DvLMzmBB97nU1tmTV/mZGIDMsJ11ruDKyCpLeqCpplB7VD GWx07+EUfVUDp+9iVRNv61+FNL8T61ndFWgnqwASCJKeotjBUzTxV5CY30Vgpg/c/NQhnxwL/Ck dSi2WNroAdJpm0YOqXQim59od4EM8i1lZjzL7BjgOVFMigpOJn6GP7wrwb6bwqZypaFdNFytynO AUZeCJAoCpClHgHL5koXQzwCtCxInN3bGVjn3tbDVbq+wCosv2XavW2EiEgbQ== X-Google-Smtp-Source: AGHT+IG8jBsrzdJBqVJTPrEb2Csym7PPrU1/28OeiLu54VeSEpWokYpDQycJjgMyw8hu2Rl2msTB5A== X-Received: by 2002:a05:600c:46c7:b0:434:a4b3:5ebe with SMTP id 5b1f17b1804b1-43668b5e244mr439084205e9.24.1736159559633; Mon, 06 Jan 2025 02:32:39 -0800 (PST) Received: from localhost ([196.207.164.177]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c828d39sm49078425f8f.9.2025.01.06.02.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2025 02:32:39 -0800 (PST) Date: Mon, 6 Jan 2025 13:32:36 +0300 From: Dan Carpenter To: Atharva Tiwari Cc: Greg Kroah-Hartman , Meir Elisha , Philipp Hortmann , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: rtl8723bs: fix network selection in rtw_mlme.c Message-ID: References: <20241224132019.75475-1-evepolonium@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: <20241224132019.75475-1-evepolonium@gmail.com> On Tue, Dec 24, 2024 at 06:50:17PM +0530, Atharva Tiwari wrote: > this patch fixes the network selection logic to avoid selecting a network > with the same ESSID as the olddest scanned network if it was scanned > within the last 500 millisecounds You need to try use proper capitalization and add periods to the end of sentences. > > and please give a specific value for "new enough" on line 481, > i have estimated 500 millisecound but inform me if the value > needs to be changed If you don't know then just leave it as-is. Don't just guess. If you have a spec or an expert to consult, that's fine, go ahead and change it in that case. But probably if the answer was really obvious, then someone would already have changed it. > > Signed-off-by: Atharva Tiwari > --- > Changes since v1: > - Changed the "new enough" value from 1000 millisecounds to 500 > - fixed some styling issue > > drivers/staging/rtl8723bs/core/rtw_mlme.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c > index 5ded183aa08c..6604619d1b99 100644 > --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c > +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c > @@ -481,8 +481,11 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t > } > > if (rtw_roam_flags(adapter)) { > - /* TODO: don't select network in the same ess as oldest if it's new enough*/ > - } > + if (is_same_ess(&pnetwork->network, &oldest->network) && > + time_after(pnetwork->last_scanned, > + (unsigned long)msecs_to_jiffies(500))) This casting is unnecessary and puzzling. > + continue; > + } This line is indented too far. regards, dan carpenter