public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nam Cao <namcao@linutronix.de>
To: Michael Straube <straube.linux@gmail.com>
Cc: gregkh@linuxfoundation.org, philipp.g.hortmann@gmail.com,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] staging: rtl8192e: remove dead code
Date: Sun, 26 May 2024 16:31:00 +0200	[thread overview]
Message-ID: <20240526143100.FmVupNWq@linutronix.de> (raw)
In-Reply-To: <20240526111928.14574-4-straube.linux@gmail.com>

On Sun, May 26, 2024 at 01:19:28PM +0200, Michael Straube wrote:
> Remove two else-if arms that do nothing.
> 
> Signed-off-by: Michael Straube <straube.linux@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
> index 5392d2daf870..4e03eb100175 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_dm.c
> @@ -1370,9 +1370,6 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev)
>  					tmp_sec_rssi = cur_rf_rssi;
>  					sec_rssi_index = i;
>  				}
> -			} else if ((cur_rf_rssi < tmp_sec_rssi) &&
> -					(cur_rf_rssi > tmp_min_rssi)) {
> -				;
>  			} else if (cur_rf_rssi == tmp_min_rssi) {
>  				if (tmp_sec_rssi == tmp_min_rssi) {
>  					tmp_min_rssi = cur_rf_rssi;
> @@ -1426,9 +1423,6 @@ static void _rtl92e_dm_rx_path_sel_byrssi(struct net_device *dev)
>  						tmp_cck_sec_pwdb = cur_cck_pwdb;
>  						cck_rx_ver2_sec_index = i;
>  					}
> -				} else if ((cur_cck_pwdb < tmp_cck_sec_pwdb) &&
> -						(cur_cck_pwdb > tmp_cck_min_pwdb)) {
> -					;
>  				} else if (cur_cck_pwdb == tmp_cck_min_pwdb) {
>  					if (tmp_cck_sec_pwdb == tmp_cck_min_pwdb)
>  						tmp_cck_min_pwdb = cur_cck_pwdb;

I would be careful with these changes. These else-if do prevent the
execution of the other else-if, so the code do not behave the same anymore.

The only case this patch doesn't change anything functionally is when the
condition of the removed if-else is mutually exclusive with the conditions
of the following if-else. Are you sure this is the case?

Best regards,
Nam

  reply	other threads:[~2024-05-26 14:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26 11:19 [PATCH 0/3] staging: rtl8192e: some refactoring Michael Straube
2024-05-26 11:19 ` [PATCH 1/3] staging: rtl8192e: reduce indentation level Michael Straube
2024-05-26 14:23   ` Nam Cao
2024-05-26 11:19 ` [PATCH 2/3] staging: rtl8192e: remove unnecessary line breaks Michael Straube
2024-05-26 14:33   ` Nam Cao
2024-05-26 11:19 ` [PATCH 3/3] staging: rtl8192e: remove dead code Michael Straube
2024-05-26 14:31   ` Nam Cao [this message]
2024-05-27  4:36     ` Michael Straube
2024-05-27  7:39       ` Dan Carpenter
2024-05-27  8:34         ` Michael Straube
2024-05-27  8:51           ` Dan Carpenter

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=20240526143100.FmVupNWq@linutronix.de \
    --to=namcao@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=philipp.g.hortmann@gmail.com \
    --cc=straube.linux@gmail.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