Skip to content
Permalink
Browse files

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 <andrew.p.boie@intel.com>
  • Loading branch information...
andrewboie authored and nashif committed Jun 12, 2019
1 parent 676b1ae commit db84a76379ee754ce76203713601856944287853
Showing with 1 addition and 7 deletions.
  1. +1 −7 lib/os/thread_entry.c
@@ -28,18 +28,12 @@ FUNC_NORETURN void z_thread_entry(k_thread_entry_t entry,
{
entry(p1, p2, p3);

#ifdef CONFIG_MULTITHREADING
k_thread_abort(k_current_get());
#else
for (;;) {
k_cpu_idle();
}
#endif

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

CODE_UNREACHABLE;
CODE_UNREACHABLE; /* LCOV_EXCL_LINE */
}

0 comments on commit db84a76

Please sign in to comment.
You can’t perform that action at this time.