sched/task: Avoid the cast in atexit when CONFIG_SCHED_ONEXIT is defined

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ic3360555fa8bb24d5dae52e7ae5bb5fb5c24de0c
This commit is contained in:
Xiang Xiao 2020-06-03 18:12:10 +08:00 committed by Abdelatif Guettouche
parent 3409c989bd
commit 09f64dd0ac

View file

@ -52,6 +52,17 @@
#ifdef CONFIG_SCHED_ATEXIT
/****************************************************************************
* Private Functions
****************************************************************************/
#ifdef CONFIG_SCHED_ONEXIT
static void exitfunc(int exitcode, FAR void *arg)
{
(*(atexitfunc_t)arg)();
}
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
@ -95,7 +106,7 @@ int atexit(void (*func)(void))
* it expects).
*/
return on_exit((onexitfunc_t)func, NULL);
return on_exit(exitfunc, func);
#else
FAR struct tcb_s *tcb = this_task();