mirror of
https://github.com/apache/nuttx.git
synced 2026-10-13 01:00:12 +00:00
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:
parent
e171f547fa
commit
a4d09a4e25
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue