kernel: fatal: Remove redundant function
We don't need re-implement a function to get the current cpu. Simply use _current_cpu that even contains additional sanity checks. Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
711c17182f
commit
121d051c9a
1 changed files with 1 additions and 10 deletions
|
@ -84,15 +84,6 @@ FUNC_NORETURN void k_fatal_halt(unsigned int reason)
|
|||
}
|
||||
/* LCOV_EXCL_STOP */
|
||||
|
||||
static inline int get_cpu(void)
|
||||
{
|
||||
#if defined(CONFIG_SMP)
|
||||
return arch_curr_cpu()->id;
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
||||
{
|
||||
/* We can't allow this code to be preempted, but don't need to
|
||||
|
@ -107,7 +98,7 @@ void z_fatal_error(unsigned int reason, const z_arch_esf_t *esf)
|
|||
* change it without also updating twister
|
||||
*/
|
||||
LOG_ERR(">>> ZEPHYR FATAL ERROR %d: %s on CPU %d", reason,
|
||||
reason_to_str(reason), get_cpu());
|
||||
reason_to_str(reason), _current_cpu->id);
|
||||
|
||||
/* FIXME: This doesn't seem to work as expected on all arches.
|
||||
* Need a reliable way to determine whether the fault happened when
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue