linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Samuel Ortiz <samuel.ortiz@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] iwm3200wifi: remove comparison to WIFI_IF_NTFY_MAX in iwm_ntf_wifi_if_wrapper
Date: Tue, 10 Aug 2010 20:02:58 +0200	[thread overview]
Message-ID: <20100810180257.GA2567@sortiz-mobl> (raw)
In-Reply-To: <1281461210-3528-1-git-send-email-linville@tuxdriver.com>

On Tue, Aug 10, 2010 at 06:26:50PM +0100, John W. Linville wrote:
> drivers/net/wireless/iwmc3200wifi/rx.c: In function 'iwm_ntf_wifi_if_wrapper':
> drivers/net/wireless/iwmc3200wifi/rx.c:1198: warning: comparison is always true due to limited range of data type
> 
> This is, of course, because the value of WIFI_IF_NTFY_MAX is 0xff and
> hdr->oid is a u8.  This is obviously an attempt to verify the range on
> an input value, but since it has no effect it can simply be removed.
> 
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Samuel Ortiz <samuel.ortiz@intel.com>

Thanks a lot John, you beat me at it.

Cheers,
Samuel.

> ---
>  drivers/net/wireless/iwmc3200wifi/rx.c |    7 ++-----
>  1 files changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwmc3200wifi/rx.c b/drivers/net/wireless/iwmc3200wifi/rx.c
> index c02fced..a944893 100644
> --- a/drivers/net/wireless/iwmc3200wifi/rx.c
> +++ b/drivers/net/wireless/iwmc3200wifi/rx.c
> @@ -1195,11 +1195,8 @@ static int iwm_ntf_wifi_if_wrapper(struct iwm_priv *iwm, u8 *buf,
>  	IWM_DBG_NTF(iwm, DBG, "WIFI_IF_WRAPPER cmd is delivered to UMAC: "
>  		    "oid is 0x%x\n", hdr->oid);
>  
> -	if (hdr->oid <= WIFI_IF_NTFY_MAX) {
> -		set_bit(hdr->oid, &iwm->wifi_ntfy[0]);
> -		wake_up_interruptible(&iwm->wifi_ntfy_queue);
> -	} else
> -		return -EINVAL;
> +	set_bit(hdr->oid, &iwm->wifi_ntfy[0]);
> +	wake_up_interruptible(&iwm->wifi_ntfy_queue);
>  
>  	switch (hdr->oid) {
>  	case UMAC_WIFI_IF_CMD_SET_PROFILE:
> -- 
> 1.7.2.1
> 

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris, 
92196 Meudon Cedex, France
Registration Number:  302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


  reply	other threads:[~2010-08-10 18:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-09 23:43 i386 allmodconfig, current mainline Andrew Morton
2010-08-09 23:48 ` Randy Dunlap
2010-08-10  0:15 ` Stephen Rothwell
2010-08-10 16:53   ` Geert Uytterhoeven
2010-08-13 16:23     ` Randy Dunlap
2010-08-10  0:32 ` David Woodhouse
2010-08-10  0:42 ` Dan Williams
2010-08-10  4:52 ` Roland Dreier
2010-08-10  7:07 ` David Miller
2010-08-10 17:13 ` [PATCH] ipw2100: avoid warning from pointer cast in call to IPW_DEBUG_TX John W. Linville
2010-08-10 17:26 ` [PATCH] iwm3200wifi: remove comparison to WIFI_IF_NTFY_MAX in iwm_ntf_wifi_if_wrapper John W. Linville
2010-08-10 18:02   ` Samuel Ortiz [this message]
2010-08-10 18:27 ` i386 allmodconfig, current mainline Phillip Lougher

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=20100810180257.GA2567@sortiz-mobl \
    --to=samuel.ortiz@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).