mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +08:00
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:
@@ -119,8 +119,6 @@ int adjtime(FAR const struct timeval *delta, FAR struct timeval *olddelta)
|
|||||||
long long incr_limit;
|
long long incr_limit;
|
||||||
int is_negative;
|
int is_negative;
|
||||||
|
|
||||||
is_negative = 0;
|
|
||||||
|
|
||||||
if (!delta)
|
if (!delta)
|
||||||
{
|
{
|
||||||
set_errno(EINVAL);
|
set_errno(EINVAL);
|
||||||
@@ -136,6 +134,10 @@ int adjtime(FAR const struct timeval *delta, FAR struct timeval *olddelta)
|
|||||||
adjust_usec = -adjust_usec;
|
adjust_usec = -adjust_usec;
|
||||||
is_negative = 1;
|
is_negative = 1;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
is_negative = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get period in usec. Target hardware has to provide support for
|
/* Get period in usec. Target hardware has to provide support for
|
||||||
* this function call.
|
* 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)
|
int group_allocate(FAR struct task_tcb_s *tcb, uint8_t ttype)
|
||||||
{
|
{
|
||||||
FAR struct task_group_s *group;
|
FAR struct task_group_s *group;
|
||||||
int ret = -ENOMEM;
|
int ret;
|
||||||
|
|
||||||
DEBUGASSERT(tcb && !tcb->cmn.group);
|
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));
|
group->tg_members = kmm_malloc(GROUP_INITIAL_MEMBERS * sizeof(pid_t));
|
||||||
if (!group->tg_members)
|
if (!group->tg_members)
|
||||||
{
|
{
|
||||||
|
ret = -ENOMEM;
|
||||||
goto errout_with_group;
|
goto errout_with_group;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,6 @@
|
|||||||
|
|
||||||
int group_setupidlefiles(void)
|
int group_setupidlefiles(void)
|
||||||
{
|
{
|
||||||
int ret = OK;
|
|
||||||
#if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL)
|
#if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL)
|
||||||
int fd;
|
int fd;
|
||||||
#endif
|
#endif
|
||||||
@@ -115,5 +114,5 @@ int group_setupidlefiles(void)
|
|||||||
#endif /* defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL) */
|
#endif /* defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL) */
|
||||||
|
|
||||||
sched_trace_end();
|
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 */
|
/* Duplicate the parent task's file descriptors */
|
||||||
|
|
||||||
ret = files_duplist(&rtcb->group->tg_filelist, &group->tg_filelist);
|
ret = files_duplist(&rtcb->group->tg_filelist, &group->tg_filelist);
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
sched_trace_end();
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sched_trace_end();
|
sched_trace_end();
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ int pthread_detach(pthread_t thread)
|
|||||||
FAR struct tcb_s *rtcb = this_task();
|
FAR struct tcb_s *rtcb = this_task();
|
||||||
FAR struct task_group_s *group = rtcb->group;
|
FAR struct task_group_s *group = rtcb->group;
|
||||||
FAR struct join_s *pjoin;
|
FAR struct join_s *pjoin;
|
||||||
int ret = OK;
|
int ret;
|
||||||
|
|
||||||
sinfo("Thread=%d group=%p\n", thread, group);
|
sinfo("Thread=%d group=%p\n", thread, group);
|
||||||
DEBUGASSERT(group);
|
DEBUGASSERT(group);
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ int nxtask_delete(pid_t pid)
|
|||||||
{
|
{
|
||||||
FAR struct tcb_s *dtcb;
|
FAR struct tcb_s *dtcb;
|
||||||
FAR struct tcb_s *rtcb;
|
FAR struct tcb_s *rtcb;
|
||||||
int ret;
|
|
||||||
|
|
||||||
/* Check if the task to delete is the calling task: PID=0 means to delete
|
/* 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()
|
* 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.
|
* nxtask_terminate() do all of the heavy lifting.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = nxtask_terminate(pid);
|
return nxtask_terminate(pid);
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
return OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user