Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp435966ybi; Fri, 31 May 2019 03:58:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqxENTLTfXoTPyN3A+hhOL3tN/6pmyWAgLra/8PthM4qOOk0xjP2hX43U0/lywToLecO38KP X-Received: by 2002:a17:90a:30a1:: with SMTP id h30mr8524282pjb.14.1559300322848; Fri, 31 May 2019 03:58:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559300322; cv=none; d=google.com; s=arc-20160816; b=VYO1k5DnIx9M2qPm7OG0tW3aCzXiECiWlolGXya87sgaSLlsKHgfclL4P4CxtkiXCx tLT4DK9aM2GYHi7a7FOcF6YrFtqLRey7OH4lmyUjCmGp45MyqBVorss96q111NDDi0xP mNzgkhVxtoU64/O47aRaZkHPvoCKmn+/2JJRcLvBwTFsYmlnccNUo9xBGgmDSRfceVgy 6T979HlBaTagX898eZWqIa7sE0khFeuwQ7LKt2RC2VnXfIZmXQJbvOLCZrIXNn1CNY/Z a5KJ17USajSABvvdiiw46josE0QWft4n+4f5kKjipl7l2BzUvPQ2DF7AqYs2griJH+yS skEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=pa8tMDJ3+yDs6qz0NaWIi9Mc0rMaWO9lXC6YPlqKS6E=; b=Dpn/uRW6MEZVCMs5oBmkLfvaW677ytCi8HBTMQFllGlElesUOh9D+iwqfUcLltCU8G GShtoCHBx80UNZZhzuJteHvLn9MEgdDsY7g1S0JQVriU7B32s9H+Cnzcjl0yW5CYsWah f/CYoz1rnAFECVgPAChl7LKk2DK5Va/36+adp1Q1Cazf77j/gHwY566A3ZQqd9WbyFMX qlRv6cIa6qd4C4ifIWSpwOVtGobs5YnWoH0KfJ8E3zXbf0DiFNvHeF7AIFMfKD8wRTZ2 KeiVQE0O6OUz7yV9MCOw0e8GU/jNjuMaepMfFUh05hMDPH7oCt/mBDxAeZhZSTl4xhI5 OYaw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c24si395496pgi.462.2019.05.31.03.58.25; Fri, 31 May 2019 03:58:42 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727141AbfEaK5O (ORCPT + 99 others); Fri, 31 May 2019 06:57:14 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:44782 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfEaK5O (ORCPT ); Fri, 31 May 2019 06:57:14 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1hWfDg-0004Th-GR; Fri, 31 May 2019 10:57:08 +0000 From: Colin King To: Andy Gross , David Brown , Amit Kucheria , Zhang Rui , Eduardo Valentin , Daniel Lezcano , linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] drivers: thermal: tsens: remove redundant u32 comparison with less than zero Date: Fri, 31 May 2019 11:57:08 +0100 Message-Id: <20190531105708.15312-1-colin.king@canonical.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The u32 variable hw_id is unsigned and cannot be less than zero so the comparison with less than zero is always false and hence is redundant and can be removed. Addresses-Coverity: ("Unsigned compared against 0") Signed-off-by: Colin Ian King --- 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..f4419f45025d 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.20.1