public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stf_xl@wp.pl>
To: Tuo Li <islituo@gmail.com>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] wifi: iwlegacy: 3945-rs: remove redundant pointer check in il3945_rs_tx_status() and il3945_rs_get_rate()
Date: Mon, 12 Jan 2026 08:03:19 +0100	[thread overview]
Message-ID: <20260112070319.GA115711@wp.pl> (raw)
In-Reply-To: <20260111171118.203249-1-islituo@gmail.com>

On Mon, Jan 12, 2026 at 01:11:18AM +0800, Tuo Li wrote:
> The variable il_sta passed into these two functions cannot be NULL, so
> remove the related null checks.
> 
> Signed-off-by: Tuo Li <islituo@gmail.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

Thanks
Stanislaw
> ---
> v4:
> * Remove the redundant NULL check instead of using WARN_ON_ONCE(), and
>   update the subject accordingly.
>   Thanks to Stanislaw Gruszka for helpful advice.
> v3:
> * Replace plain NULL check with WARN_ON_ONCE() and update subject to better
>   reflect defensive nature of the check.
>   Thanks to Johannes Berg and Stanislaw Gruszka for helpful advice.
> v2:
> * Return early for uninitialized STA il data and align D_RATE messages with
>   il3945_rs_tx_status(). Add a wifi: prefix to the patch title.
>   Thanks to Stanislaw Gruszka for the helpful advice.
> ---
>  drivers/net/wireless/intel/iwlegacy/3945-rs.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlegacy/3945-rs.c b/drivers/net/wireless/intel/iwlegacy/3945-rs.c
> index 1826c37c090c..ecc6c8d2a4c5 100644
> --- a/drivers/net/wireless/intel/iwlegacy/3945-rs.c
> +++ b/drivers/net/wireless/intel/iwlegacy/3945-rs.c
> @@ -448,11 +448,6 @@ il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *sband,
>  		return;
>  	}
>  
> -	if (!il_sta) {
> -		D_RATE("leave: No STA il data to update!\n");
> -		return;
> -	}
> -
>  	/* Treat uninitialized rate scaling data same as non-existing. */
>  	if (!rs_sta->il) {
>  		D_RATE("leave: STA il data uninitialized!\n");
> @@ -627,7 +622,7 @@ il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
>  	D_RATE("enter\n");
>  
>  	/* Treat uninitialized rate scaling data same as non-existing. */
> -	if (rs_sta && !rs_sta->il) {
> +	if (!rs_sta->il) {
>  		D_RATE("Rate scaling information not initialized yet.\n");
>  		il_sta = NULL;
>  	}
> -- 
> 2.43.0
> 

      reply	other threads:[~2026-01-12  7:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11 17:11 [PATCH v4] wifi: iwlegacy: 3945-rs: remove redundant pointer check in il3945_rs_tx_status() and il3945_rs_get_rate() Tuo Li
2026-01-12  7:03 ` Stanislaw Gruszka [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=20260112070319.GA115711@wp.pl \
    --to=stf_xl@wp.pl \
    --cc=islituo@gmail.com \
    --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