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 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2025-08-21 11:23:50 +08:00 • committed by Alan C. Assis
parent e171f547fa
commit a4d09a4e25

View file

@ -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;