Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4010878ybi; Mon, 27 May 2019 09:23:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkiKnhEohXMAbJ5U90wo4pxdN+9TGePiIOYhtaLT7heR/ET1nMR/ZER46nMRnmaSXCkiPM X-Received: by 2002:a17:90a:9202:: with SMTP id m2mr32528702pjo.37.1558974210844; Mon, 27 May 2019 09:23:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558974210; cv=none; d=google.com; s=arc-20160816; b=ZJGMVbxDjjE7PcX7TpaOD4Jc1yWT3q6wh4AQLI2XnjMLCOV50W8uX9C+SvNLZMfjoR 94yY8gk47zr9qJbfAvXHACyUn3s96pjbVWTbq7Lv7cjQuMH/fC1CuiQB/MMBQNIERgiT dr98ckjhCdDDadjzYuG45GJxE/wCodnrOr9fvAnA/w4yydfROIAhQqchP3svDluw5ko5 SBmPt7g/WDZn+uFsXUwQ5rtGNlHpw4kmo1Du+YawJpZ3jltHMplR/YG2X1TLGTjyFzH0 LbnubFySl7NOVvxbfbyRJDlgFd/ReCAdexFDen6GLxFT8vnfZb3cqkKM0+h/oH/sdwF6 NqXw== 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=ySymd6KFiTDvLPE5wDAKYLF+k4a/t4KCDroAeXh4hLk=; b=NSmsDaMgKB1fLx90CRr7rpFtZadHkAUpjzuGACk8njKAS3LvjmjH2AwCOz45wrrrCD 3z7pP5D30PIQJYkPYhnUYpAE95Cu154OrTZ37IIVkwg4BF141XjlyCjBi/qLVR5rPMMS Lm6Z22vCo+zHlFh0WlgeaRJMdskc//A3UuY5Tgb+DA4q9dxnCTQ4H9EsKN2iqL+kHjvM G10Jlg4ljW5Cva6Ve4eeK7h0rms5vMusYY7rv32GBFmvGX879bMGWVhn8/GFI1K9QolD e17DHDCyw87GpaFT05r5Thc5ubFMTDEo327LDpJ8CQaID30vY0dzqDP3cMSvB5q8oJrn GElw== 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 p11si20208607pjf.108.2019.05.27.09.23.15; Mon, 27 May 2019 09:23:30 -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 S1726693AbfE0QIx (ORCPT + 99 others); Mon, 27 May 2019 12:08:53 -0400 Received: from gateway20.websitewelcome.com ([192.185.65.13]:35775 "EHLO gateway20.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725991AbfE0QIw (ORCPT ); Mon, 27 May 2019 12:08:52 -0400 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 731CD40112065 for ; Mon, 27 May 2019 10:08:13 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id VIAlhkce0YTGMVIAlhkSKK; Mon, 27 May 2019 11:08:27 -0500 X-Authority-Reason: nr=8 Received: from [189.250.47.159] (port=33436 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.91) (envelope-from ) id 1hVIAk-001oQ4-O2; Mon, 27 May 2019 11:08:26 -0500 Date: Mon, 27 May 2019 11:08:25 -0500 From: "Gustavo A. R. Silva" To: Amit Kucheria , Andy Gross , David Brown , Zhang Rui , Eduardo Valentin , Daniel Lezcano Cc: linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] thermal: tsens: Remove unnecessary comparison of unsigned integer with < 0 Message-ID: <20190527160825.GA24219@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.47.159 X-Source-L: No X-Exim-ID: 1hVIAk-001oQ4-O2 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [189.250.47.159]:33436 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 9 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 hw_id with < 0 because such comparison of an unsigned value is always false. Fix this by removing such comparison. 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) -- 2.21.0