Message ID | 20230106005951.100479-1-yang.lee@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp573407wrt; Thu, 5 Jan 2023 17:05:19 -0800 (PST) X-Google-Smtp-Source: AMrXdXvH+pYc7dsqwdKuXbZFlcKymbhQ1WOsdmp07AwzGKuNAsfATfv+bbReStgFdMv9ibLmh0ej X-Received: by 2002:a17:906:b041:b0:7c1:22a6:818e with SMTP id bj1-20020a170906b04100b007c122a6818emr45816807ejb.24.1672967118918; Thu, 05 Jan 2023 17:05:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672967118; cv=none; d=google.com; s=arc-20160816; b=QMTOnqmqmXI0IBNQ3taRtn0Oph1t3Fe95hGyrdPGnGnxOeYbu1Dn2tlLqlAlBdz0Zg nZkJikd7+ZRtkkGM6e+L6QkGZw6odqmZg5KPH5OJ34A1EXQbjW/gMh7O6m08LCLvee6s ZDU+SuAaVQN8rIJF/b2yBowSBZqPuAEIEx0vPAkuLriAuIuncAtKv376FvqLYcgnzwTq LeqJ09aqSEjQ8ZJQo58v3uZlAttt7zQO3dduNEzJuma1APzFCfu5wniXKeMtiM8Joj6f +OOe4nAH7K6bSG8lan3URkuiIxrPSeHX0OTVB4xMAiTzc30j0iV3cktfwCeFh1JvULJD zpyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mQo7rh4STFHCNtrJi/4PmA/XrSBXHFW1cHvaM3Aw9vg=; b=UQdVjzfU4v4WanMOJenrO5MIveathw+YXD6SapCxyrp2xqmhV6F+Y7+zUEVMAocCSS dFZGKEjNhkPG2J2DWzP8cNaHChrZX1vNrOIW/c4wa/wOXEtYsis5PeXLZj/lujZEgTTg T9PYzJUMlQrwT8LIWRlNT+SXvP6wuRwmKWuvWT6KjlL581z9GstE02T6HBOv6CsFZ2SP Iy8gtqHGREkS/UckdhRUIsAgaMLZNfjlD2GNsQUDQlS6411xkgH/Du254uD8jJ/3p4SP 5oQqzB3pKflakVFgt6588/zeTgNw1DQvr/IjFUWQO8UNiIXSinoeLVaQOwLpcGXpJHHV so2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wy10-20020a170906fe0a00b0084ca4bdbc7bsi19244724ejb.799.2023.01.05.17.04.55; Thu, 05 Jan 2023 17:05:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235881AbjAFBAD (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Thu, 5 Jan 2023 20:00:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbjAFA77 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 5 Jan 2023 19:59:59 -0500 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47EE11A81D; Thu, 5 Jan 2023 16:59:57 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=yang.lee@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VYxG4-k_1672966794; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0VYxG4-k_1672966794) by smtp.aliyun-inc.com; Fri, 06 Jan 2023 08:59:55 +0800 From: Yang Li <yang.lee@linux.alibaba.com> To: rafael@kernel.org Cc: daniel.lezcano@linaro.org, amitk@kernel.org, rui.zhang@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Yang Li <yang.lee@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH -next] thermal: Fix unsigned comparison with less than zero Date: Fri, 6 Jan 2023 08:59:51 +0800 Message-Id: <20230106005951.100479-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754233170001259416?= X-GMAIL-MSGID: =?utf-8?q?1754233170001259416?= |
Series |
[-next] thermal: Fix unsigned comparison with less than zero
|
|
Commit Message
Yang Li
Jan. 6, 2023, 12:59 a.m. UTC
The return value from the call to intel_tcc_get_tjmax() is int, which can
be a negative error code. However, the return value is being assigned to
an u32 variable 'tj_max', so making 'tj_max' an int.
Eliminate the following warning:
./drivers/thermal/intel/intel_soc_dts_iosf.c:394:5-11: WARNING: Unsigned expression compared with zero: tj_max < 0
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3637
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, 2023-01-06 at 08:59 +0800, Yang Li wrote: > The return value from the call to intel_tcc_get_tjmax() is int, which > can > be a negative error code. However, the return value is being assigned > to > an u32 variable 'tj_max', so making 'tj_max' an int. > > Eliminate the following warning: > ./drivers/thermal/intel/intel_soc_dts_iosf.c:394:5-11: WARNING: > Unsigned expression compared with zero: tj_max < 0 > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3637 > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Thanks for catching this issue. Acked-by: Zhang Rui <rui.zhang@intel.com> thanks, rui > --- > drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c > b/drivers/thermal/intel/intel_soc_dts_iosf.c > index 2138693d8afd..8c26f7b2316b 100644 > --- a/drivers/thermal/intel/intel_soc_dts_iosf.c > +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c > @@ -380,7 +380,7 @@ struct intel_soc_dts_sensors > *intel_soc_dts_iosf_init( > { > struct intel_soc_dts_sensors *sensors; > bool notification; > - u32 tj_max; > + int tj_max; > int ret; > int i; >
On Fri, Jan 6, 2023 at 8:03 AM Zhang, Rui <rui.zhang@intel.com> wrote: > > On Fri, 2023-01-06 at 08:59 +0800, Yang Li wrote: > > The return value from the call to intel_tcc_get_tjmax() is int, which > > can > > be a negative error code. However, the return value is being assigned > > to > > an u32 variable 'tj_max', so making 'tj_max' an int. > > > > Eliminate the following warning: > > ./drivers/thermal/intel/intel_soc_dts_iosf.c:394:5-11: WARNING: > > Unsigned expression compared with zero: tj_max < 0 > > > > Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3637 > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > > Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> > > Thanks for catching this issue. > > Acked-by: Zhang Rui <rui.zhang@intel.com> Applied, thanks! > > --- > > drivers/thermal/intel/intel_soc_dts_iosf.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c > > b/drivers/thermal/intel/intel_soc_dts_iosf.c > > index 2138693d8afd..8c26f7b2316b 100644 > > --- a/drivers/thermal/intel/intel_soc_dts_iosf.c > > +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c > > @@ -380,7 +380,7 @@ struct intel_soc_dts_sensors > > *intel_soc_dts_iosf_init( > > { > > struct intel_soc_dts_sensors *sensors; > > bool notification; > > - u32 tj_max; > > + int tj_max; > > int ret; > > int i; > >
diff --git a/drivers/thermal/intel/intel_soc_dts_iosf.c b/drivers/thermal/intel/intel_soc_dts_iosf.c index 2138693d8afd..8c26f7b2316b 100644 --- a/drivers/thermal/intel/intel_soc_dts_iosf.c +++ b/drivers/thermal/intel/intel_soc_dts_iosf.c @@ -380,7 +380,7 @@ struct intel_soc_dts_sensors *intel_soc_dts_iosf_init( { struct intel_soc_dts_sensors *sensors; bool notification; - u32 tj_max; + int tj_max; int ret; int i;