From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B869C00449 for ; Fri, 5 Oct 2018 19:20:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5E632084D for ; Fri, 5 Oct 2018 19:20:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C5E632084D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=embeddedor.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728766AbeJFCUf (ORCPT ); Fri, 5 Oct 2018 22:20:35 -0400 Received: from gateway24.websitewelcome.com ([192.185.51.139]:28246 "EHLO gateway24.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728214AbeJFCUf (ORCPT ); Fri, 5 Oct 2018 22:20:35 -0400 X-Greylist: delayed 1407 seconds by postgrey-1.27 at vger.kernel.org; Fri, 05 Oct 2018 22:20:35 EDT Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 7F13521A7 for ; Fri, 5 Oct 2018 13:57:06 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 8VH0gMOLa8YaU8VHOgosYX; Fri, 05 Oct 2018 13:57:06 -0500 X-Authority-Reason: nr=8 Received: from 174.206.93.92.rev.sfr.net ([92.93.206.174]:41882 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1g8VGz-0006ox-5t; Fri, 05 Oct 2018 13:56:25 -0500 Date: Fri, 5 Oct 2018 20:56:23 +0200 From: "Gustavo A. R. Silva" To: Kalle Valo , "David S. Miller" Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0 Message-ID: <20181005185623.GA14405@embeddedor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 92.93.206.174 X-Source-L: No X-Exim-ID: 1g8VGz-0006ox-5t X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174.206.93.92.rev.sfr.net (embeddedor) [92.93.206.174]:41882 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 10 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There is no need to compare *ps_state_enable* with < 0 because such variable is of type u8 (8 bits, unsigned), making it impossible to hold a negative value. Fix this by removing such comparison. Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 2c0cb67..15964b3 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -2421,7 +2421,7 @@ static ssize_t ath10k_write_ps_state_enable(struct file *file, if (kstrtou8_from_user(user_buf, count, 0, &ps_state_enable)) return -EINVAL; - if (ps_state_enable > 1 || ps_state_enable < 0) + if (ps_state_enable > 1) return -EINVAL; mutex_lock(&ar->conf_mutex); -- 2.7.4 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from gateway31.websitewelcome.com ([192.185.143.5]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8VHq-0001NZ-Eq for ath10k@lists.infradead.org; Fri, 05 Oct 2018 18:57:19 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 847DD3F6B9 for ; Fri, 5 Oct 2018 13:57:06 -0500 (CDT) Date: Fri, 5 Oct 2018 20:56:23 +0200 From: "Gustavo A. R. Silva" Subject: [PATCH] ath10k: remove unnecessary comparison of unsigned integer with < 0 Message-ID: <20181005185623.GA14405@embeddedor.com> MIME-Version: 1.0 Content-Disposition: inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Kalle Valo , "David S. Miller" Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, "Gustavo A. R. Silva" There is no need to compare *ps_state_enable* with < 0 because such variable is of type u8 (8 bits, unsigned), making it impossible to hold a negative value. Fix this by removing such comparison. Addresses-Coverity-ID: 1473921 ("Unsigned compared against 0") Signed-off-by: Gustavo A. R. Silva --- drivers/net/wireless/ath/ath10k/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c index 2c0cb67..15964b3 100644 --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -2421,7 +2421,7 @@ static ssize_t ath10k_write_ps_state_enable(struct file *file, if (kstrtou8_from_user(user_buf, count, 0, &ps_state_enable)) return -EINVAL; - if (ps_state_enable > 1 || ps_state_enable < 0) + if (ps_state_enable > 1) return -EINVAL; mutex_lock(&ar->conf_mutex); -- 2.7.4 _______________________________________________ ath10k mailing list ath10k@lists.infradead.org http://lists.infradead.org/mailman/listinfo/ath10k