Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp535863img; Mon, 18 Mar 2019 08:35:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRQiGzNSOOSQB0A+eWB3ELW/wbHR+mh+98riJLI9AZjumeHt47lhGRuhhhY0Vb51M88uLm X-Received: by 2002:a62:be02:: with SMTP id l2mr19824741pff.55.1552923359805; Mon, 18 Mar 2019 08:35:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552923359; cv=none; d=google.com; s=arc-20160816; b=cJFnP2cjZHwpm6HV5YZ1lIce3XrxXn+3a/iHlDpjU6sz/BePux1nRfycYcRsRomEGe YWBeBbaZS+vT9teR5pYXyqUuvFP4+ZmffLOUDKgXrVJVobezxgAmXo9BbNyfabg4ub0R aQ1VvvwScvA0CHRI7mgDuVUpk/49LA0k+Q80Kqe2TuwCU9RIP3nt42JBdGIFlAUlxdJl iVadKgYZKjw96GdXhdBZBtIZkDm8+kqRIoe1ak+/zZVCfIt/YtHgh1k1V1Y1nDiWrLyN P9iQLq/yp8mzv7DP7GheMn/6QO8zCziBMq8fOAq739UZAOFubHuAcdmPKXTs03eU82/I fpFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=rLtqGgELmJBMTPksTUMtCtoBk0vh777p8s2OTNZw2Xo=; b=CcjeGLj5axYiszIFKuAKmYLqocpJt0fiqO/KnY2rBVqZEHTSAk1DO2aZUHWf9pKFeW R7/DPoQieajY+6vr7Nhc8DXBF2LUwbkeK5xPVUipAgwjwC7k0H8KzFbwVkKf0zmDme4D OgLFfpaMFOJxM/UkCCx+7I4F9MwK6Hw17M4xHkI/1nPCLrX+5EmvKOvY/cUVuro0UQMX XrUnEZqugyVkwEX8vI3tVzLKLuW17xTm4BkBWrTgsidGI10sZzq1u9P22WzVwSVBVLAV NQE2hoA0gr53wf9J3Y9y2xVW+nZHrNF3SjfhPP3s/PY8w4bnWyzf2fsI2B+LolybGqce h8ug== 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 l6si8793048pgq.305.2019.03.18.08.35.44; Mon, 18 Mar 2019 08:35:59 -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 S1727247AbfCRPec (ORCPT + 99 others); Mon, 18 Mar 2019 11:34:32 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:44103 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726678AbfCRPeb (ORCPT ); Mon, 18 Mar 2019 11:34:31 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1h5uHS-0007s2-Ke; Mon, 18 Mar 2019 16:34:26 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1h5uHR-0005rp-N5; Mon, 18 Mar 2019 16:34:25 +0100 Date: Mon, 18 Mar 2019 16:34:25 +0100 From: Marco Felsch To: "Gustavo A. R. Silva" Cc: Richard Leitner , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: usb251xb: Remove unnecessary comparison of unsigned integer with >= 0 Message-ID: <20190318153425.rxx3fwq2hi6tfocr@pengutronix.de> References: <20190318145024.GA572@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190318145024.GA572@embeddedor> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 16:31:53 up 58 days, 20:13, 51 users, load average: 0.00, 0.00, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Silva, On 19-03-18 09:50, Gustavo A. R. Silva wrote: > There is no need to compare *port* with >= 0 because such comparison > of an unsigned value is always true. Absolutly.. It seems that it was an copy'n'paste failure. Thanks for fixing that. Regards, Marco > 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 > > -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |