Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3846406ybi; Mon, 27 May 2019 07:03:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqzjC23wyjZxlLq+7E3v43Q6wrVLP4dKKVdKZWXGEZYRfha7OjkFBip8H40ruBCKQ4rEQrP8 X-Received: by 2002:a65:6108:: with SMTP id z8mr9142684pgu.128.1558965813312; Mon, 27 May 2019 07:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558965813; cv=none; d=google.com; s=arc-20160816; b=0YRc/TsYMsDq+VTePsmd67KtilnE+ZbZNLFvGy//rGHYw8cJR0XEdCLZr6RCy1EL9I ev+Axjy/slOq2Kn7EmeSJIBUc5e+xNA2gvzbnF0h5blqYklEPlnnUE86g7BuM4nrVeBM 2gobjKKCxePGFfNqLM6TfOc2eLA2gwOSC7O0x/BC2k/oR6J6Cs4JaQ0VAk4daV1TtmVJ swhXQwhaRMIk4G4FdrYJP22y6Q5addq+WJwNxRrTNSI+96i5ze6slpv76m6AtjdqQKvS GT/Sy4jzFz8HQteI11zwm2ftzv5up9Cwoco9GlfMWyRPdQZzu1S9OK2qVP76NPbbs+ef UByg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=7xRWBtJCbhqkVrqguL7XTCkgw8OlfDyGs9WbojZ6vac=; b=McS8k1MwiaH5TQo/Ez5Wjv1Cl0rmQ2oXzpUh2+DKRLt2D8E8PupKcC6Ny6RMyNp2D2 f6yjPuiyXZCBWqwgMi2aXt8QWLcvvXdbDdzDrTyG4F1zzHsfw/xf2YyzRWvl4sGvPir9 Wap2e072dIJ/+Enln45Y++xe3SLFUbdXNNwZRJE71j34kgZ4sKCWvUQSy0L72Xvx6uHG F6MaNJqrn8dNVxACGkULbh+GJ7ak1X1l4VSMYimS+KZPKbQ5e8tM2FO/tTwcZds4fItN 8qZJDrXRMHaZKIK5Zi5/sOhIdusj94qVg62jUxh3mvjGfoDWtKt/TR+xeAPxD3sqrHXR 1reg== 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 n13si18459616pgv.304.2019.05.27.07.03.15; Mon, 27 May 2019 07:03:33 -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 S1726435AbfE0N75 (ORCPT + 99 others); Mon, 27 May 2019 09:59:57 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:50108 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726185AbfE0N75 (ORCPT ); Mon, 27 May 2019 09:59:57 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id BCDD59305DE19F6E293A; Mon, 27 May 2019 21:44:03 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.439.0; Mon, 27 May 2019 21:43:55 +0800 From: YueHaibing To: , , , , , CC: , , , YueHaibing Subject: [PATCH -next] drivers: thermal: tsens: Change hw_id type to int in is_sensor_enabled Date: Mon, 27 May 2019 21:41:24 +0800 Message-ID: <20190527134124.14784-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sensor hw_id is int type other u32, is_sensor_enabled should use int to compare, this fix smatch warning: drivers/thermal/qcom/tsens-common.c:72 is_sensor_enabled() warn: unsigned 'hw_id' is never less than zero. Fixes: 3e6a8fb33084 ("drivers: thermal: tsens: Add new operation to check if a sensor is enabled") Signed-off-by: YueHaibing --- drivers/thermal/qcom/tsens-common.c | 2 +- drivers/thermal/qcom/tsens.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/qcom/tsens-common.c b/drivers/thermal/qcom/tsens-common.c index 928e8e81ba69..5df4eed84535 100644 --- a/drivers/thermal/qcom/tsens-common.c +++ b/drivers/thermal/qcom/tsens-common.c @@ -64,7 +64,7 @@ void compute_intercept_slope(struct tsens_priv *priv, u32 *p1, } } -bool is_sensor_enabled(struct tsens_priv *priv, u32 hw_id) +bool is_sensor_enabled(struct tsens_priv *priv, int hw_id) { u32 val; int ret; diff --git a/drivers/thermal/qcom/tsens.h b/drivers/thermal/qcom/tsens.h index eefe3844fb4e..15264806f6a8 100644 --- a/drivers/thermal/qcom/tsens.h +++ b/drivers/thermal/qcom/tsens.h @@ -315,7 +315,7 @@ void compute_intercept_slope(struct tsens_priv *priv, u32 *pt1, u32 *pt2, u32 mo int init_common(struct tsens_priv *priv); int get_temp_tsens_valid(struct tsens_priv *priv, int i, int *temp); int get_temp_common(struct tsens_priv *priv, int i, int *temp); -bool is_sensor_enabled(struct tsens_priv *priv, u32 hw_id); +bool is_sensor_enabled(struct tsens_priv *priv, int hw_id); /* TSENS target */ extern const struct tsens_plat_data data_8960; -- 2.17.1