]> git.baikalelectronics.ru Git - kernel.git/commit
thermal: intel: Fix unsigned comparison with less than zero
authorYang Li <yang.lee@linux.alibaba.com>
Fri, 6 Jan 2023 00:59:51 +0000 (08:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:49 +0000 (09:33 +0100)
commitb9cdff8d19e83e81a5a6c2f65768fb03d613be9f
tree6156cfcfa2da74a59fec88662af1dccb7c1a3931
parent6b6985fe2bc4dd99304ac783b6eeae1da576f307
thermal: intel: Fix unsigned comparison with less than zero

[ Upstream commit 553dc2e19e67c8fadcb6f9344c896a34160419af ]

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>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/intel/intel_soc_dts_iosf.c