From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: Saurav Girepunje <saurav.girepunje@gmail.com>
Cc: gregkh@linuxfoundation.org, marcocesati@gmail.com,
dan.carpenter@oracle.com, lee.jones@linaro.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
saurav.girepunje@hotmail.com
Subject: Re: [PATCH] staging: rtl8723bs: hal: remove if condition which is always false
Date: Sun, 10 Oct 2021 12:50:39 +0200 [thread overview]
Message-ID: <YWLFf1zPvK9gz+7+@agape.jhs> (raw)
In-Reply-To: <YWKXKGuA/Io9sEjf@user>
Hello Surav,
thanks for your patch, see a comment below,
On Sun, Oct 10, 2021 at 01:02:56PM +0530, Saurav Girepunje wrote:
> Remove the if condition which is always false. The last update on
> variable max_rf_path is value 1. It's value is not changing after that.
> So if condition check for value 2 will be always false only.
>
> Signed-off-by: Saurav Girepunje <saurav.girepunje@gmail.com>
> ---
> drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c
> index 392cc8a398f5..612575ba961a 100644
> --- a/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c
> +++ b/drivers/staging/rtl8723bs/hal/odm_NoiseMonitor.c
> @@ -106,12 +106,10 @@ static s16 odm_InbandNoise_Monitor_NSeries(
> pDM_Odm->noise_level.noise[RF_PATH_A] = -110 + reg_c50 + noise_data.sum[RF_PATH_A];
> pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[RF_PATH_A];
>
> - if (max_rf_path == 2) {
> - reg_c58 = (s32)PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XBAGCCore1, bMaskByte0);
> - reg_c58 &= ~BIT7;
> - pDM_Odm->noise_level.noise[RF_PATH_B] = -110 + reg_c58 + noise_data.sum[RF_PATH_B];
> - pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[RF_PATH_B];
> - }
> + reg_c58 = (s32)PHY_QueryBBReg(pDM_Odm->Adapter, rOFDM0_XBAGCCore1, bMaskByte0);
> + reg_c58 &= ~BIT7;
> + pDM_Odm->noise_level.noise[RF_PATH_B] = -110 + reg_c58 + noise_data.sum[RF_PATH_B];
> + pDM_Odm->noise_level.noise_all += pDM_Odm->noise_level.noise[RF_PATH_B];
> pDM_Odm->noise_level.noise_all /= max_rf_path;
If the condition is always false the whole block can be wiped out,
why did you keep it? Did you change the logic here?
>
> /* */
> --
> 2.32.0
>
thank you,
fabio
next prev parent reply other threads:[~2021-10-10 10:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-10 7:32 Saurav Girepunje
2021-10-10 10:50 ` Fabio Aiuto [this message]
2021-10-10 11:02 ` Saurav Girepunje
2021-10-11 10:41 ` Dan Carpenter
2021-10-11 17:11 ` Saurav Girepunje
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YWLFf1zPvK9gz+7+@agape.jhs \
--to=fabioaiuto83@gmail.com \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=marcocesati@gmail.com \
--cc=saurav.girepunje@gmail.com \
--cc=saurav.girepunje@hotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®