linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Austin Kim <austindh.kim@gmail.com>,
	arend.vanspriel@broadcom.com, franky.lin@broadcom.com,
	hante.meuleman@broadcom.com, chi-hsien.lin@cypress.com,
	wright.feng@cypress.com, kvalo@codeaurora.org,
	davem@davemloft.net
Cc: linux-wireless@vger.kernel.org,
	brcm80211-dev-list.pdl@broadcom.com,
	brcm80211-dev-list@cypress.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] brcmsmac: Remove always false 'channel < 0' statement
Date: Wed, 27 Nov 2019 13:48:19 +0300	[thread overview]
Message-ID: <46dfe877-4f32-b763-429f-7af3a83828f0@cogentembedded.com> (raw)
In-Reply-To: <20191127054358.GA59549@LGEARND20B15>

On 27.11.2019 8:43, Austin Kim wrote:

> As 'channel' is declared as u16, the following statement is always false.
>     channel < 0
> 
> So we can remove unnecessary 'always false' statement.

    It's an expression, not a statement.

> Signed-off-by: Austin Kim <austindh.kim@gmail.com>
> ---
>   drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
> index 3f09d89..7f2c15c 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
> +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c
> @@ -5408,7 +5408,7 @@ int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel)
>   {
>   	u16 chspec = ch20mhz_chspec(channel);
>   
> -	if (channel < 0 || channel > MAXCHANNEL)
> +	if (channel > MAXCHANNEL)
>   		return -EINVAL;
>   
>   	if (!brcms_c_valid_chanspec_db(wlc->cmi, chspec))

MBR, Sergei


  reply	other threads:[~2019-11-27 10:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-27  5:43 [PATCH] brcmsmac: Remove always false 'channel < 0' statement Austin Kim
2019-11-27 10:48 ` Sergei Shtylyov [this message]
2019-11-27 13:02   ` Austin Kim
2019-11-27 13:35     ` Kalle Valo
     [not found]     ` <0101016ead12c253-18d4624e-98eb-4252-ba3a-fabf74d831f2-000000@us-west-2.amazonses.com>
2019-11-27 22:21       ` Austin Kim
2019-12-18 18:28 ` Kalle Valo

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=46dfe877-4f32-b763-429f-7af3a83828f0@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=arend.vanspriel@broadcom.com \
    --cc=austindh.kim@gmail.com \
    --cc=brcm80211-dev-list.pdl@broadcom.com \
    --cc=brcm80211-dev-list@cypress.com \
    --cc=chi-hsien.lin@cypress.com \
    --cc=davem@davemloft.net \
    --cc=franky.lin@broadcom.com \
    --cc=hante.meuleman@broadcom.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=wright.feng@cypress.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).