Skip to content

Commit db84a76

Browse files
Andrew Boienashif
authored andcommitted
lib: os: remove dead code
If multithreading is disabled, thread_entry() never runs since we cannot create threads; the non-multithreading case was simply dead code. Indicate to code coverage that CODE_UNREACHABLE should be skipped. Signed-off-by: Andrew Boie <[email protected]>
1 parent 676b1ae commit db84a76

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lib/os/thread_entry.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ FUNC_NORETURN void z_thread_entry(k_thread_entry_t entry,
2828
{
2929
entry(p1, p2, p3);
3030

31-
#ifdef CONFIG_MULTITHREADING
3231
k_thread_abort(k_current_get());
33-
#else
34-
for (;;) {
35-
k_cpu_idle();
36-
}
37-
#endif
3832

3933
/*
4034
* Compiler can't tell that k_thread_abort() won't return and issues a
4135
* warning unless we tell it that control never gets this far.
4236
*/
4337

44-
CODE_UNREACHABLE;
38+
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
4539
}

0 commit comments

Comments
 (0)