Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5762398ybi; Tue, 28 May 2019 19:37:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzwcrl5g0Vj1AyniO7lWDrg1zXGEzdRKGt1xon/gP4ql0EJ6vM64Xp/VLSBOJkycv2JgO6Z X-Received: by 2002:a65:628d:: with SMTP id f13mr34363739pgv.177.1559097470680; Tue, 28 May 2019 19:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559097470; cv=none; d=google.com; s=arc-20160816; b=kfztq4zvmEmGXtOWEhi48ClBzrqLXIffsv5Ke1Giz+RPE/3jEQjYaCn2TsyzxRYfXO 2xKduxngVVL9RLqI3WE10yBBDhx40GAbK6rtz7DyXcgNrxp5HAdWj0iexakreQPvo6ME Lv9u0tUZDQwo+vCQuBWyh8WHgor6GRELj1QxBqE4OTsekTkcCxjxv6MQblMjbU9fGpVw nGBN1YiKl5rb6mV4M2jPFiAwsciuSd6FKdP+XxFt0mDzEeiNrnRYAhW1lAvkU9sgu6lk RHzneNSq2/JQKBGlytlBcKgkW8lvfMeMlaGpRTWT4RPdAf3mF21TNlx1nGWjqwdXY+AE Tfxw== 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:dkim-signature; bh=UqRabNjRPQnvgjnJWF/HLeVUAOQcKrxoLjz5Ks5Zk14=; b=xlz3M9/kuR1XUMMy5s7qso5KC+I6b53EteudLY/VzLwnaTReua19MRTmN08CXsf63f vPpsME8llOR6/kkz2Yhp/KBjJ9BoVJJptfWnsJJTWx53CUfz/Lp368HNdMbxM5DVC/7Y 5NrNIEZHyfl/f+dMt3M2jsmq8OZz+lcQBQPInZkuCj4K2c+t40Ckx+Iyb82R5iOA9FL4 aO8+dmzPxdPx1OOCFUBqIA0TexG1pemrCc+EDzbDHC1fVmDdcZhSl1We0VWbyVpz6pw1 DfWoa+2T8a2ZsprwjJL1GPJWd7oPY7iG9KZWozVw/wCHT+u1wvtivMICxbyIneFbtdiA SIGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="OJXX/kFs"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 133si22991036pga.130.2019.05.28.19.37.33; Tue, 28 May 2019 19:37:50 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="OJXX/kFs"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbfE2Cg0 (ORCPT + 99 others); Tue, 28 May 2019 22:36:26 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:40197 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725856AbfE2Cg0 (ORCPT ); Tue, 28 May 2019 22:36:26 -0400 Received: by mail-pg1-f196.google.com with SMTP id d30so387016pgm.7; Tue, 28 May 2019 19:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=UqRabNjRPQnvgjnJWF/HLeVUAOQcKrxoLjz5Ks5Zk14=; b=OJXX/kFsoeR3LwmcfwQsZnMVH3PNFHcXhM9qHlO/L/wpIMSIaTvv8+ING/er21ZLqE Te++GrRmdRj7xB/Nv5yC843zINnESjIZp0W7Dsd2qtBP6N526UHClF4iyvHvFR3JJUxm Uc4APeNqqfVl+hm+zZuQu8AnM+4unTrPVzr3jPQaTRqcpDFm5MBAdSXnhhNH6As7Juhv Vw4NBvgClLUaXBeQi3E9Qs2Bx524dOyUgUWHu2gH0tWxJkYD6n21bIdKfObJIn6UfxnL AzDLh6LKUk5SxkBJSYP3dkO50jmqMMXJO8kilJC55tTJKtA/80rcxenJvtkj4sPf121j oVhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=UqRabNjRPQnvgjnJWF/HLeVUAOQcKrxoLjz5Ks5Zk14=; b=rskH8luBAqJtqggcuwHUYvAGhTNaxDmPh61iXZN6yMwEn0covnKVczP8CSO/wpQ9Pf bz2wL4N1NYwaHc/eTqUZXpLXQXfCO+SmbOiLme8T9CIHeiQYMie6xUDjD7IM8DqmCCUF i/82du4bxsUH9oHhm1m2iFrpfhYykwGZRF3jdhzkUdEVwOS7UIpWtKQTYuFtdPAk+jeZ eyDszRehuWe8llcvUy7iXtK4lm4oLkQ3LjJxAgGUcBXB0K3A1AI2IAUe/GE4riFQ/m9A MVntrOrHhN3nGdCq9uyNZ7MfKVpzfwuhn414NqqZyRDFiIBmqd+kh/dE/r4KMmPA5hGB AkJQ== X-Gm-Message-State: APjAAAU4tJ3wlkaTXPGKuLL3sY6MFN5rkkNoEUYI2JgEdv4NqU4RxHLm Q6b6aqdu36g7T5+cbMPxsVE81LwN X-Received: by 2002:a05:6a00:43:: with SMTP id i3mr68656219pfk.113.1559097385629; Tue, 28 May 2019 19:36:25 -0700 (PDT) Received: from localhost.localdomain ([2601:644:8201:32e0:7256:81ff:febd:926d]) by smtp.gmail.com with ESMTPSA id f186sm19896792pfb.5.2019.05.28.19.36.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 May 2019 19:36:24 -0700 (PDT) Date: Tue, 28 May 2019 19:36:22 -0700 From: Eduardo Valentin To: "Gustavo A. R. Silva" Cc: Amit Kucheria , Andy Gross , David Brown , Zhang Rui , Daniel Lezcano , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] thermal: tsens: Remove unnecessary comparison of unsigned integer with < 0 Message-ID: <20190529023619.GA12875@localhost.localdomain> References: <20190527160825.GA24219@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190527160825.GA24219@embeddedor> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Gustavo, On Mon, May 27, 2019 at 11:08:25AM -0500, Gustavo A. R. Silva wrote: > There is no need to compare hw_id with < 0 because such comparison > of an unsigned value is always false. > > Fix this by removing such comparison. Thanks for fixing this. But we had to revert the commit that introduces this issue. So this patch is no longer applicable. > > Addresses-Coverity-ID: 1445440 ("Unsigned compared against 0") > Fixes: 3e6a8fb33084 ("drivers: thermal: tsens: Add new operation to check if a sensor is enabled") > Signed-off-by: Gustavo A. R. Silva > --- > drivers/thermal/qcom/tsens-common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c > index 928e8e81ba69..94878ad35464 100644 > --- a/drivers/thermal/qcom/tsens-common.c > +++ b/drivers/thermal/qcom/tsens-common.c > @@ -69,7 +69,7 @@ bool is_sensor_enabled(struct tsens_priv *priv, u32 hw_id) > u32 val; > int ret; > > - if ((hw_id > (priv->num_sensors - 1)) || (hw_id < 0)) > + if (hw_id > priv->num_sensors - 1) > return -EINVAL; > ret = regmap_field_read(priv->rf[SENSOR_EN], &val); > if (ret)