netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Toke Høiland-Jørgensen" <toke@toke.dk>
To: Tom Rix <trix@redhat.com>,
	kvalo@kernel.org, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com
Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, Tom Rix <trix@redhat.com>
Subject: Re: [PATCH] ath9k: remove setting of 'is_ext' parameter
Date: Mon, 23 May 2022 11:32:57 +0200	[thread overview]
Message-ID: <871qwkr3ue.fsf@toke.dk> (raw)
In-Reply-To: <20220521204725.2539952-1-trix@redhat.com>

Tom Rix <trix@redhat.com> writes:

> cppcheck reports
> [drivers/net/wireless/ath/ath9k/dfs.c:93]: (style) Assignment of function parameter has no effect outside the function.
>
> Both the is_ctl and the is_ext parameters are set in the if-else statement.
> But only is_ctl is used later, so setting is_ext is not needed and can be removed.
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  drivers/net/wireless/ath/ath9k/dfs.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/dfs.c b/drivers/net/wireless/ath/ath9k/dfs.c
> index acb9602aa464..47cdfb584eb0 100644
> --- a/drivers/net/wireless/ath/ath9k/dfs.c
> +++ b/drivers/net/wireless/ath/ath9k/dfs.c
> @@ -89,8 +89,6 @@ static int ath9k_get_max_index_ht40(struct ath9k_dfs_fft_40 *fft,
>  			int mag_upper = fft_max_magnitude(fft->upper_bins);
>  			if (mag_upper > mag_lower)
>  				is_ctl = false;
> -			else
> -				is_ext = false;

Hmm, not so sure about this; while the assignment is technically
useless, I think it makes the intent of the code clearer (i.e.,
disambiguating between is_ctl or is_ext; upon exiting that block is_ctl
or is_ext will always be false(...

-Toke

      reply	other threads:[~2022-05-23  9:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-21 20:47 [PATCH] ath9k: remove setting of 'is_ext' parameter Tom Rix
2022-05-23  9:32 ` Toke Høiland-Jørgensen [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=871qwkr3ue.fsf@toke.dk \
    --to=toke@toke.dk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=trix@redhat.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;
as well as URLs for NNTP newsgroup(s).