Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp501084img; Mon, 18 Mar 2019 07:53:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWB4VyaO+a1jWDBbsvVG0LSJUGghCFVp/2OtenRidlCa5p/qUxF+vuAqdfe9DIMXTto3Ht X-Received: by 2002:a17:902:f302:: with SMTP id gb2mr20550264plb.51.1552920805988; Mon, 18 Mar 2019 07:53:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552920805; cv=none; d=google.com; s=arc-20160816; b=e+Ujf+I3T5wVrxrs3LgUOo5KMXMvIBgpVzR6OYc6oMzLc3z0fYVOse27K9YGU5RXBE v3U7ahO2REFFE9DgvjfMr9eBH7xqMOdlvomk8ZXFuOFpVAJL5ExMHNE0gldOmoJEJZpI fSpSkqcFlXtBYyWXsjajxtOmkURFwS2bylk4B3OJZNHZK58UF2AYr3YQyodALeqTG7WZ pAyuEXPLg6hTn9PZJ9YIUfKnANoMYUwQ010j1QrijQf6X1ESTOlpVFU8OXMeaS8suxlu c48Nucl8YlIC3dgQTvPFiGXpCICXGWkCZfBIaTa6r6cbXQ07hRaB86gwZWsNS+4Bbkdi Ehpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date; bh=viIoLp3egEJl7QasXoanAALlRMFL+X03mJpZLoFD968=; b=pDIBD/xeq+K0sssy+nlzRauYer4hX7QDcCyANsXk9dNxYFcj6g+M9Hz4F79BRCgKit FfM04CbJJGceDXpNVFFhXd0l8ak+JxtlWYB7L9HMz2zJfMCUVvcFifJTU+QTv0QMnWZO kNdX5L7M3HlRchzW2Qdgy+Srxwf+RUlAOOiBVin0dn1hLIsocfVGZSZQxZ2v2AmCM2RK LoAd1sqAbs35HQIPyBaQNe2zoS6+9jOCfW/FNp3H5xfr5MM3YqzdDd5WCxV59AOrbI/a TpYt2KyZmscRjRBDW3zfNBTmb1Jei4PxmGOcRxZ4rc1QmRVJeTobwjTbiYrP58u5zWmh BPwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u18si9559877pfm.84.2019.03.18.07.53.10; Mon, 18 Mar 2019 07:53:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727457AbfCROvG (ORCPT + 99 others); Mon, 18 Mar 2019 10:51:06 -0400 Received: from gateway31.websitewelcome.com ([192.185.143.43]:34011 "EHLO gateway31.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbfCROvG (ORCPT ); Mon, 18 Mar 2019 10:51:06 -0400 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id D8EBE444EF for ; Mon, 18 Mar 2019 09:51:04 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id 5tbUhXQuNYTGM5tbUhkfKe; Mon, 18 Mar 2019 09:51:04 -0500 X-Authority-Reason: nr=8 Received: from [189.250.104.39] (port=37488 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1h5tas-0049al-Id; Mon, 18 Mar 2019 09:51:03 -0500 Date: Mon, 18 Mar 2019 09:50:24 -0500 From: "Gustavo A. R. Silva" To: Richard Leitner , Greg Kroah-Hartman , Marco Felsch Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] usb: usb251xb: Remove unnecessary comparison of unsigned integer with >= 0 Message-ID: <20190318145024.GA572@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) 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: 189.250.104.39 X-Source-L: No X-Exim-ID: 1h5tas-0049al-Id X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.104.39]:37488 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to compare *port* with >= 0 because such comparison of an unsigned value is always true. Fix this by removing such comparison. Addresses-Coverity-ID: 1443949 ("Unsigned compared against 0") Fixes: 02a50b875046 ("usb: usb251xb: add usb data lane port swap feature") Signed-off-by: Gustavo A. R. Silva --- drivers/usb/misc/usb251xb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/misc/usb251xb.c b/drivers/usb/misc/usb251xb.c index 4d72b7d1d383..2c8e2cad7e10 100644 --- a/drivers/usb/misc/usb251xb.c +++ b/drivers/usb/misc/usb251xb.c @@ -547,7 +547,7 @@ static int usb251xb_get_ofdata(struct usb251xb *hub, */ hub->port_swap = USB251XB_DEF_PORT_SWAP; of_property_for_each_u32(np, "swap-dx-lanes", prop, p, port) { - if ((port >= 0) && (port <= data->port_cnt)) + if (port <= data->port_cnt) hub->port_swap |= BIT(port); } -- 2.21.0