[PATCH 1/2] x86: Fix return value in frequency invariance setup for XEON_PHI_KNL/KNM

From: Giovanni Gherdovich
Date: Fri May 20 2022 - 12:11:42 EST


knl_set_max_freq_ratio() should return true on success and false
otherwise. If the last line of the function body is reached, it means no
appropriate value for turbo_freq was found: the setup is unsuccessful and
it should return false.

Fixes: 8bea0dfb4a82 ("x86, sched: Add support for frequency invariance on XEON_PHI_KNL/KNM")
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Giovanni Gherdovich <ggherdovich@xxxxxxx>
---
arch/x86/kernel/smpboot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2ef14772dc04..225a3c31297c 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1985,7 +1985,7 @@ static bool knl_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq,
i += 8;
} while (i < 64);

- return true;
+ return false;
}

static bool skx_set_max_freq_ratio(u64 *base_freq, u64 *turbo_freq, int size)
--
2.31.1