]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cpu: imx8_cpu: Provide default temperatures
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 24 Jul 2025 14:46:49 +0000 (15:46 +0100)
committerFabio Estevam <festevam@gmail.com>
Thu, 7 Aug 2025 11:15:00 +0000 (08:15 -0300)
Add setting default temperatures to the weak version of
get_cpu_temp_grade so these values will not be used uninitialised.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/cpu/imx8_cpu.c

index 4836bddd93b13a2b1e0b75297ae1bfe3ad4e90b3..950630453f9d3415293c28063cbc48d391840011 100644 (file)
@@ -201,6 +201,10 @@ static int cpu_imx_get_temp(struct cpu_imx_plat *plat)
 
 __weak u32 get_cpu_temp_grade(int *minc, int *maxc)
 {
+       if (minc && maxc) {
+               *minc = 0;
+               *maxc = 95;
+       }
        return 0;
 }