sched: fix the minor style issue
and remove the unused return value Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
50b17fb3fc
commit
87d6084f31
@ -119,8 +119,6 @@ int adjtime(FAR const struct timeval *delta, FAR struct timeval *olddelta)
|
||||
long long incr_limit;
|
||||
int is_negative;
|
||||
|
||||
is_negative = 0;
|
||||
|
||||
if (!delta)
|
||||
{
|
||||
set_errno(EINVAL);
|
||||
@ -136,6 +134,10 @@ int adjtime(FAR const struct timeval *delta, FAR struct timeval *olddelta)
|
||||
adjust_usec = -adjust_usec;
|
||||
is_negative = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
is_negative = 0;
|
||||
}
|
||||
|
||||
/* Get period in usec. Target hardware has to provide support for
|
||||
* this function call.
|
||||
|
@ -129,7 +129,7 @@ static inline void group_inherit_identity(FAR struct task_group_s *group)
|
||||
int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
|
||||
{
|
||||
FAR struct task_group_s *group;
|
||||
int ret = -ENOMEM;
|
||||
int ret;
|
||||
|
||||
DEBUGASSERT(tcb && !tcb->cmn.group);
|
||||
|
||||
@ -158,6 +158,7 @@ int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
|
||||
group->tg_members = kmm_malloc(GROUP_INITIAL_MEMBERS * sizeof(pid_t));
|
||||
if (!group->tg_members)
|
||||
{
|
||||
ret = -ENOMEM;
|
||||
goto errout_with_group;
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,6 @@
|
||||
|
||||
int group_setupidlefiles(void)
|
||||
{
|
||||
int ret = OK;
|
||||
#if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL)
|
||||
int fd;
|
||||
#endif
|
||||
@ -115,5 +114,5 @@ int group_setupidlefiles(void)
|
||||
#endif /* defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL) */
|
||||
|
||||
sched_trace_end();
|
||||
return ret;
|
||||
return OK;
|
||||
}
|
||||
|
@ -76,11 +76,6 @@ int group_setuptaskfiles(FAR struct task_tcb_s *tcb)
|
||||
/* Duplicate the parent task's file descriptors */
|
||||
|
||||
ret = files_duplist(&rtcb->group->tg_filelist, &group->tg_filelist);
|
||||
if (ret < 0)
|
||||
{
|
||||
sched_trace_end();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
sched_trace_end();
|
||||
|
@ -65,7 +65,7 @@ int pthread_detach(pthread_t thread)
|
||||
FAR struct tcb_s *rtcb = this_task();
|
||||
FAR struct task_group_s *group = rtcb->group;
|
||||
FAR struct join_s *pjoin;
|
||||
int ret = OK;
|
||||
int ret;
|
||||
|
||||
sinfo("Thread=%d group=%p\n", thread, group);
|
||||
DEBUGASSERT(group);
|
||||
|
@ -66,7 +66,6 @@ int nxtask_delete(pid_t pid)
|
||||
{
|
||||
FAR struct tcb_s *dtcb;
|
||||
FAR struct tcb_s *rtcb;
|
||||
int ret;
|
||||
|
||||
/* Check if the task to delete is the calling task: PID=0 means to delete
|
||||
* the calling task. In this case, task_delete() is much like exit()
|
||||
@ -132,13 +131,7 @@ int nxtask_delete(pid_t pid)
|
||||
* nxtask_terminate() do all of the heavy lifting.
|
||||
*/
|
||||
|
||||
ret = nxtask_terminate(pid);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
return OK;
|
||||
return nxtask_terminate(pid);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user