Linux-Wireless Archive mirror
 help / color / mirror / Atom feed
From: Ping-Ke Shih <pkshih@realtek.com>
To: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Cc: "kvalo@kernel.org" <kvalo@kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: RE: [PATCH] wifi: rtw89: Remove useless else
Date: Mon, 22 Apr 2024 06:02:14 +0000	[thread overview]
Message-ID: <cb9af3b7db9c464b80fbde62ec57f18e@realtek.com> (raw)
In-Reply-To: <20240422055022.33388-1-jiapeng.chong@linux.alibaba.com>

Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:

> Subject: [PATCH] wifi: rtw89: Remove useless else

Please point out the stuff like functions you are changing. 

> 
> The assignment of the else and if branches is the same, so the else
> here is redundant, so we remove it.
> 
> ./drivers/net/wireless/realtek/rtw89/phy.c:6406:2-4: WARNING: possible condition with no effect (if ==
> else).
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8812
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/net/wireless/realtek/rtw89/phy.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
> index eaa18140d1a8..ca5a098c30a4 100644
> --- a/drivers/net/wireless/realtek/rtw89/phy.c
> +++ b/drivers/net/wireless/realtek/rtw89/phy.c
> @@ -6403,10 +6403,7 @@ enum rtw89_rf_path_bit rtw89_phy_get_kpath(struct rtw89_dev *rtwdev,
>                         return RF_D;
>         case MLO_0_PLUS_2_1RF:
>         case MLO_2_PLUS_0_1RF:
> -               if (phy_idx == RTW89_PHY_0)
> -                       return RF_AB;
> -               else
> -                       return RF_AB;
> +               return RF_AB;

The PHY configures to corresponding MLO modes are complicated, so RF people
always add branches of phy_idx to prevent missing something, and this is
intentionally to say two cases are identical. It is fine to apply your patch,
but please add a comment to note that, like

/* for both PHY 0/1 */

>         case MLO_0_PLUS_2_2RF:
>         case MLO_2_PLUS_0_2RF:
>         case MLO_2_PLUS_2_2RF:
> --
> 2.20.1.7.g153144c
> 


      reply	other threads:[~2024-04-22  6:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-22  5:50 [PATCH] wifi: rtw89: Remove useless else Jiapeng Chong
2024-04-22  6:02 ` Ping-Ke Shih [this message]

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=cb9af3b7db9c464b80fbde62ec57f18e@realtek.com \
    --to=pkshih@realtek.com \
    --cc=abaci@linux.alibaba.com \
    --cc=jiapeng.chong@linux.alibaba.com \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).