From: Ping-Ke Shih <pkshih@realtek.com>
To: Jeff Johnson <quic_jjohnson@quicinc.com>,
Colin Ian King <colin.i.king@gmail.com>,
Kalle Valo <kvalo@kernel.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][next] wifi: rtw89: 8852a: remove redundant else statement
Date: Thu, 31 Oct 2024 02:22:55 +0000 [thread overview]
Message-ID: <7aad60c126214fdf9fd144d0a085b3fd@realtek.com> (raw)
In-Reply-To: <eb39e027-7ab4-4062-a895-cac28d37a8a6@quicinc.com>
Jeff Johnson <quic_jjohnson@quicinc.com> wrote:
> On 10/30/2024 6:14 AM, Colin Ian King wrote:
> > The cascaded if statements covers all 16 bit values in the comparisons
> > of dgain and the last else statement is not reachable and hence
> > dead code. Remove it.
> >
> > Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
> > ---
> > drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c | 2 --
> > 1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c b/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
> > index 9db8713ac99b..f3568c4d0af6 100644
> > --- a/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
> > +++ b/drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c
> > @@ -2248,8 +2248,6 @@ static s8 _dpk_dgain_mapping(struct rtw89_dev *rtwdev, u16 dgain)
> > offset = -9;
> > else if (dgain <= 0x155)
>
> should you drop the test and unconditionally return -12 here?
Agree +1. People don't suspect the else case at first glance.
>
> > offset = -12;
> > - else
> > - offset = 0x0;
> >
> > return offset;
> > }
>
next prev parent reply other threads:[~2024-10-31 2:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-30 13:14 [PATCH][next] wifi: rtw89: 8852a: remove redundant else statement Colin Ian King
2024-10-30 20:55 ` Jeff Johnson
2024-10-31 2:22 ` Ping-Ke Shih [this message]
2024-11-01 18:22 ` kernel test robot
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=7aad60c126214fdf9fd144d0a085b3fd@realtek.com \
--to=pkshih@realtek.com \
--cc=colin.i.king@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_jjohnson@quicinc.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