From patchwork Fri Sep 22 08:44:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schmidt X-Patchwork-Id: 9965553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E46060381 for ; Fri, 22 Sep 2017 08:51:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EADF62980A for ; Fri, 22 Sep 2017 08:51:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFEAC29821; Fri, 22 Sep 2017 08:51:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 110F52980A for ; Fri, 22 Sep 2017 08:51:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751852AbdIVIvO (ORCPT ); Fri, 22 Sep 2017 04:51:14 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:54677 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751826AbdIVIvO (ORCPT ); Fri, 22 Sep 2017 04:51:14 -0400 X-Greylist: delayed 355 seconds by postgrey-1.27 at vger.kernel.org; Fri, 22 Sep 2017 04:51:14 EDT Received: from work.Speedport_W_724V_09011603_05_010 (pD9F78968.dip0.t-ipconnect.de [217.247.137.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan@sostec.de) by proxima.lasnet.de (Postfix) with ESMTPSA id 2F8FFC6401; Fri, 22 Sep 2017 10:45:18 +0200 (CEST) From: Stefan Schmidt To: linux-wpan@vger.kernel.org Cc: Alexander Aring , Stefan Schmidt Subject: [PATCH] ieee802154: atusb: fix firmware version check to enable frame retries Date: Fri, 22 Sep 2017 10:44:57 +0200 Message-Id: <20170922084457.30497-1-stefan@osg.samsung.com> X-Mailer: git-send-email 2.13.5 Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Signed-off-by: Stefan Schmidt --- 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);