Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] libertas: correct "limited range of data type" warning
@ 2008-09-15 21:27 John W. Linville
  2008-09-17  4:11 ` Dan Williams
  0 siblings, 1 reply; 2+ messages in thread
From: John W. Linville @ 2008-09-15 21:27 UTC (permalink / raw)
  To: linux-wireless; +Cc: dcbw, John W. Linville

  CC [M]  drivers/net/wireless/libertas/wext.o
drivers/net/wireless/libertas/wext.c: In function =E2=80=98lbs_get_rts=E2=
=80=99:
drivers/net/wireless/libertas/wext.c:307: warning: comparison is always
false due to limited range of data type

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/wireless/libertas/wext.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireles=
s/libertas/wext.c
index 1156be5..11297dc 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -281,7 +281,7 @@ static int lbs_set_rts(struct net_device *dev, stru=
ct iw_request_info *info,
 	if (vwrq->disabled)
 		val =3D MRVDRV_RTS_MAX_VALUE;
=20
-	if (val < MRVDRV_RTS_MIN_VALUE || val > MRVDRV_RTS_MAX_VALUE)
+	if (val > MRVDRV_RTS_MAX_VALUE) /* min rts value is 0 */
 		return -EINVAL;
=20
 	ret =3D lbs_set_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, (u16) val)=
;
@@ -304,8 +304,7 @@ static int lbs_get_rts(struct net_device *dev, stru=
ct iw_request_info *info,
 		goto out;
=20
 	vwrq->value =3D val;
-	vwrq->disabled =3D ((val < MRVDRV_RTS_MIN_VALUE)
-			  || (val > MRVDRV_RTS_MAX_VALUE));
+	vwrq->disabled =3D val > MRVDRV_RTS_MAX_VALUE; /* min rts value is 0 =
*/
 	vwrq->fixed =3D 1;
=20
 out:
--=20
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libertas: correct "limited range of data type" warning
  2008-09-15 21:27 [PATCH] libertas: correct "limited range of data type" warning John W. Linville
@ 2008-09-17  4:11 ` Dan Williams
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Williams @ 2008-09-17  4:11 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless

On Mon, 2008-09-15 at 17:27 -0400, John W. Linville wrote:
> CC [M]  drivers/net/wireless/libertas/wext.o
> drivers/net/wireless/libertas/wext.c: In function =E2=80=98lbs_get_rt=
s=E2=80=99:
> drivers/net/wireless/libertas/wext.c:307: warning: comparison is alwa=
ys
> false due to limited range of data type
>=20
> Signed-off-by: John W. Linville <linville@tuxdriver.com>

Acked-by: Dan Williams <dcbw@redhat.com>

> ---
>  drivers/net/wireless/libertas/wext.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
>=20
> diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wirel=
ess/libertas/wext.c
> index 1156be5..11297dc 100644
> --- a/drivers/net/wireless/libertas/wext.c
> +++ b/drivers/net/wireless/libertas/wext.c
> @@ -281,7 +281,7 @@ static int lbs_set_rts(struct net_device *dev, st=
ruct iw_request_info *info,
>  	if (vwrq->disabled)
>  		val =3D MRVDRV_RTS_MAX_VALUE;
> =20
> -	if (val < MRVDRV_RTS_MIN_VALUE || val > MRVDRV_RTS_MAX_VALUE)
> +	if (val > MRVDRV_RTS_MAX_VALUE) /* min rts value is 0 */
>  		return -EINVAL;
> =20
>  	ret =3D lbs_set_snmp_mib(priv, SNMP_MIB_OID_RTS_THRESHOLD, (u16) va=
l);
> @@ -304,8 +304,7 @@ static int lbs_get_rts(struct net_device *dev, st=
ruct iw_request_info *info,
>  		goto out;
> =20
>  	vwrq->value =3D val;
> -	vwrq->disabled =3D ((val < MRVDRV_RTS_MIN_VALUE)
> -			  || (val > MRVDRV_RTS_MAX_VALUE));
> +	vwrq->disabled =3D val > MRVDRV_RTS_MAX_VALUE; /* min rts value is =
0 */
>  	vwrq->fixed =3D 1;
> =20
>  out:

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-17  4:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-15 21:27 [PATCH] libertas: correct "limited range of data type" warning John W. Linville
2008-09-17  4:11 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox