diff mbox

ieee802154: atusb: fix firmware version check to enable frame retries

Message ID 20170922084457.30497-1-stefan@osg.samsung.com
State Accepted
Headers show

Commit Message

Stefan Schmidt Sept. 22, 2017, 8:44 a.m. UTC
Geert reported: as fw_ver_maj is unsigned char, gcc 4.1.2 complains:

warning: comparison is always true due to limited range of data type

Besides the warning the old check would also fail for firmware versions
like 1.x with x < 3. These would support frame retries, but the driver
would not enable the feature.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/atusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefan Schmidt Sept. 26, 2017, 1:45 p.m. UTC | #1
Hello.

On 09/22/2017 10:44 AM, Stefan Schmidt wrote:
> Geert reported: as fw_ver_maj is unsigned char, gcc 4.1.2 complains:
> 
> warning: comparison is always true due to limited range of data type
> 
> Besides the warning the old check would also fail for firmware versions
> like 1.x with x < 3. These would support frame retries, but the driver
> would not enable the feature.
> 
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/atusb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 115fa3f37a86..6b3cdf4bd667 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -1060,7 +1060,7 @@ static int atusb_probe(struct usb_interface *interface,
>  	atusb_get_and_show_build(atusb);
>  	atusb_set_extended_addr(atusb);
>  
> -	if (atusb->fw_ver_maj >= 0 && atusb->fw_ver_min >= 3)
> +	if ((atusb->fw_ver_maj == 0 && atusb->fw_ver_min >= 3) || atusb->fw_ver_maj > 0)
>  		hw->flags |= IEEE802154_HW_FRAME_RETRIES;
>  
>  	ret = atusb_get_and_clear_error(atusb);
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt
--
To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 115fa3f37a86..6b3cdf4bd667 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -1060,7 +1060,7 @@  static int atusb_probe(struct usb_interface *interface,
 	atusb_get_and_show_build(atusb);
 	atusb_set_extended_addr(atusb);
 
-	if (atusb->fw_ver_maj >= 0 && atusb->fw_ver_min >= 3)
+	if ((atusb->fw_ver_maj == 0 && atusb->fw_ver_min >= 3) || atusb->fw_ver_maj > 0)
 		hw->flags |= IEEE802154_HW_FRAME_RETRIES;
 
 	ret = atusb_get_and_clear_error(atusb);