From a4d09a4e25d54c95c522359746a0ac622331752b Mon Sep 17 00:00:00 2001 From: hujun5 Date: Thu, 21 Aug 2025 11:23:50 +0800 Subject: [PATCH] sched_sysinfo.c: misra_c_2012_rule_9_1_violation: uninit_use Initialize the cpuload_s structure with zero values at declaration to eliminate uninitialized variable usage. This resolves MISRA C 2012 Rule 9.1 violation and ensures consistent, predictable system information retrieval behavior. Signed-off-by: hujun5 --- sched/sched/sched_sysinfo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sched/sched/sched_sysinfo.c b/sched/sched/sched_sysinfo.c index 4edefd8a7a1..081ea81c7e3 100644 --- a/sched/sched/sched_sysinfo.c +++ b/sched/sched/sched_sysinfo.c @@ -49,7 +49,12 @@ int sysinfo(FAR struct sysinfo *info) { #ifndef CONFIG_SCHED_CPULOAD_NONE - struct cpuload_s cpuload; + struct cpuload_s cpuload = + { + 0, + 0 + }; + #endif #ifdef CONFIG_MM_PGALLOC struct pginfo_s pginfo;