]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86/amd/pmf: Fix unsigned comparison with less than zero
authorYang Li <yang.lee@linux.alibaba.com>
Thu, 27 Jul 2023 01:43:15 +0000 (09:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:47:53 +0000 (09:47 +0200)
commit1185de708ec8e511ccc1f81a7fa29b8183ac9963
treea6b0562e03f20028da88c29e78b009432ef885ca
parentd2007c8a7429c95490f9abe40ece3b09afd41499
platform/x86/amd/pmf: Fix unsigned comparison with less than zero

[ Upstream commit 785c00993dc4c4bb2f7b0f3a3f29c03a6f7aab2e ]

The return value from the call to amd_pmf_get_pprof_modes() is int.
However, the return value is being assigned to an unsigned char
variable 'mode', so making 'mode' an int.

silence the warning:
./drivers/platform/x86/amd/pmf/sps.c:183:5-9: WARNING: Unsigned expression compared with zero: mode < 0

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5995
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20230727014315.51375-1-yang.lee@linux.alibaba.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/amd/pmf/sps.c