kernel: smp: avoid identifier collisions

MISRA-C Rule 5.3 states that identifiers in inner scope should
not hide identifiers in outer scope.

In the function smp_init_top(), the variable "start_flags"
collide with global variable of the same name. So rename the one
inside the function.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2020-07-23 14:33:31 -07:00 committed by Anas Nashif
commit ac53880cef

View file

@ -63,11 +63,11 @@ void z_smp_release_global_lock(struct k_thread *thread)
#if CONFIG_MP_NUM_CPUS > 1 #if CONFIG_MP_NUM_CPUS > 1
static FUNC_NORETURN void smp_init_top(void *arg) static FUNC_NORETURN void smp_init_top(void *arg)
{ {
atomic_t *start_flag = arg; atomic_t *cpu_start_flag = arg;
struct k_thread dummy_thread; struct k_thread dummy_thread;
/* Wait for the signal to begin scheduling */ /* Wait for the signal to begin scheduling */
while (!atomic_get(start_flag)) { while (!atomic_get(cpu_start_flag)) {
} }
z_dummy_thread_init(&dummy_thread); z_dummy_thread_init(&dummy_thread);