Skip to content

Commit 7583696

Browse files
ioannisgnashif
authored andcommitted
kernel: remove redundant #ifdef CONFIG_MULTITHREADING
Remove a redundant #ifdef CONFIG_MULTITHREADING guard for a code block already inside CONFIG_MULTITHREADING. Add some inline #endif comments for ease of reading. Signed-off-by: Ioannis Glaropoulos <[email protected]>
1 parent 5a709f5 commit 7583696

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/init.c

+2-4
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static void init_idle_thread(struct k_thread *thr, k_thread_stack_t *stack)
303303
K_LOWEST_THREAD_PRIO, K_ESSENTIAL, IDLE_THREAD_NAME);
304304
z_mark_thread_as_started(thr);
305305
}
306-
#endif
306+
#endif /* CONFIG_MULTITHREADING */
307307

308308
/**
309309
*
@@ -347,7 +347,7 @@ static void prepare_multithreading(struct k_thread *dummy_thread)
347347
#ifdef CONFIG_USERSPACE
348348
dummy_thread->mem_domain_info.mem_domain = 0;
349349
#endif
350-
#endif
350+
#endif /* CONFIG_ARCH_HAS_CUSTOM_SWAP_TO_MAIN */
351351

352352
/* _kernel.ready_q is all zeroes */
353353
z_sched_init();
@@ -374,11 +374,9 @@ static void prepare_multithreading(struct k_thread *dummy_thread)
374374
z_mark_thread_as_started(_main_thread);
375375
z_ready_thread(_main_thread);
376376

377-
#ifdef CONFIG_MULTITHREADING
378377
init_idle_thread(_idle_thread, _idle_stack);
379378
_kernel.cpus[0].idle_thread = _idle_thread;
380379
sys_trace_thread_create(_idle_thread);
381-
#endif
382380

383381
#if defined(CONFIG_SMP) && CONFIG_MP_NUM_CPUS > 1
384382
init_idle_thread(_idle_thread1, _idle_stack1);

0 commit comments

Comments
 (0)