From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C61C43168FB for ; Thu, 9 Apr 2026 14:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775744069; cv=none; b=o5kE09SzUScIQvtIz5B5LAAz0ksmUW3Oubl10AQl32X/WXX0NWDQwUMbM94XesqQ8dvbai7koxmKJX8tQitd1DsAzor2yvX9IX0E/puOpFgA8+82YPSs1s4JqKYzhd2U826cVeaAWvKnIdNOSGISop8PSfLdKj1i8cg6xMBdDeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775744069; c=relaxed/simple; bh=1lYV5wxp1fvY9dfn23S2jpsf6Eph2SRbcZKN/9BY09s=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=sOKrhd4vFc0xyG3eTxE+vUl/iMhyqREA6Gv/GxW60lPo2TmjKXrfRwS6UgGJnYDfdi1k240wKxaBZgPyejv9esYVo5etY7CS8X6efzc25UWRJzNa59FrzuKfgvoCXMRgRt5dtJkZved6T5tNQ4qkgDW3/YU07c5y6id5sS+xZms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=uyWCpVIi; arc=none smtp.client-ip=95.215.58.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uyWCpVIi" Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1775744065; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1XOkTL6Vy9oXswTh4Ftv7uZVb70YfX+Re87k79xzSaM=; b=uyWCpVIirc70+5IDMCOQ+sazYjAsxoN+rb4tHnsqr8lblsJwQzEREBSC5LCg8epW+JkhgR zT9z18sgT11+AYPphXS6cUuIzhy0uyDAu6Tx4vL2nVyTAPpoQh/Bb7citUJJakk4xR302Y +cpjr4+KnL4OnpstAdHnWEa8blX5c4I= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 09 Apr 2026 16:14:15 +0200 Message-Id: Cc: , , , , , Subject: Re: [PATCH v4 5/5] staging: rtl8723bs: remove duplicate rate checks in PHY_GetTxPowerIndexBase() X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Luka Gejak" To: "Prithvi Tambewagh" , , , , , , , , , , , , , , , , , , , , , , References: <20260409135026.137904-1-activprithvi@gmail.com> <20260409135026.137904-6-activprithvi@gmail.com> In-Reply-To: <20260409135026.137904-6-activprithvi@gmail.com> X-Migadu-Flow: FLOW_OUT On Thu Apr 9, 2026 at 3:50 PM CEST, Prithvi Tambewagh wrote: > The code previously checked (Rate >=3D MGN_MCS0 && Rate <=3D MGN_MCS7) > condition twice - once for the (BandWidth =3D=3D CHANNEL_WIDTH_20) check = and > once for the (BandWidth =3D=3D CHANNEL_WIDTH_40) check. Fix if statement > formatting to move that if check as an outer if check to improve code > formatting. > > Signed-off-by: Prithvi Tambewagh > --- > drivers/staging/rtl8723bs/hal/hal_com_phycfg.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c b/drivers/sta= ging/rtl8723bs/hal/hal_com_phycfg.c > index 2746da0a9846..45dbe1782bae 100644 > --- a/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c > +++ b/drivers/staging/rtl8723bs/hal/hal_com_phycfg.c > @@ -473,11 +473,10 @@ u8 PHY_GetTxPowerIndexBase( > if ((Rate >=3D MGN_6M && Rate <=3D MGN_54M) && !IS_CCK_RATE(Rate)) > txPower +=3D pHalData->OFDM_24G_Diff[RFPath][TX_1S]; > =20 > - if (BandWidth =3D=3D CHANNEL_WIDTH_20) { /* BW20-1S, BW20-2S */ > - if (MGN_MCS0 <=3D Rate && Rate <=3D MGN_MCS7) > + if (Rate >=3D MGN_MCS0 && Rate <=3D MGN_MCS7) { > + if (BandWidth =3D=3D CHANNEL_WIDTH_20) /* BW20-1S, BW20-2S */ > txPower +=3D pHalData->BW20_24G_Diff[RFPath][TX_1S]; > - } else if (BandWidth =3D=3D CHANNEL_WIDTH_40) { /* BW40-1S, BW40-2S */ > - if (MGN_MCS0 <=3D Rate && Rate <=3D MGN_MCS7) > + else if (BandWidth =3D=3D CHANNEL_WIDTH_40) /* BW40-1S, BW40-2S */ > txPower +=3D pHalData->BW40_24G_Diff[RFPath][TX_1S]; > } > =20 LGTM. Reviewed-by: Luka Gejak Best regards, Luka Gejak