From a34be7f7c252d966d81c4687180bc304cecd6cba Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 15 Oct 2023 14:27:39 +0800 Subject: [PATCH] sched: Remove the unused tcb argument from group_setupidlefiles Signed-off-by: Xiang Xiao --- sched/group/group.h | 2 +- sched/group/group_setupidlefiles.c | 13 ++++++------- sched/init/nx_start.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sched/group/group.h b/sched/group/group.h index 7988e6c1ce..ee07650323 100644 --- a/sched/group/group.h +++ b/sched/group/group.h @@ -119,7 +119,7 @@ void group_remove_children(FAR struct task_group_s *group); /* Group data resource configuration */ -int group_setupidlefiles(FAR struct task_tcb_s *tcb); +int group_setupidlefiles(void); int group_setuptaskfiles(FAR struct task_tcb_s *tcb); #endif /* __SCHED_GROUP_GROUP_H */ diff --git a/sched/group/group_setupidlefiles.c b/sched/group/group_setupidlefiles.c index 91f83e83e5..b79b8dbd35 100644 --- a/sched/group/group_setupidlefiles.c +++ b/sched/group/group_setupidlefiles.c @@ -49,7 +49,7 @@ * Configure the idle thread's TCB. * * Input Parameters: - * tcb - tcb of the idle task. + * None. * * Returned Value: * 0 is returned on success; a negated errno value is returned on a @@ -57,7 +57,7 @@ * ****************************************************************************/ -int group_setupidlefiles(FAR struct task_tcb_s *tcb) +int group_setupidlefiles(void) { int ret = OK; #if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL) @@ -65,7 +65,6 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) #endif sched_trace_begin(); - DEBUGASSERT(tcb->cmn.group != NULL); /* Open stdin, dup to get stdout and stderr. This should always * be the first file opened and, hence, should always get file @@ -73,11 +72,11 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) */ #if defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL) -#ifdef CONFIG_DEV_CONSOLE +# ifdef CONFIG_DEV_CONSOLE fd = nx_open("/dev/console", O_RDWR); -#else +# else fd = nx_open("/dev/null", O_RDWR); -#endif +# endif if (fd == 0) { /* Successfully opened stdin (fd == 0) */ @@ -112,7 +111,7 @@ int group_setupidlefiles(FAR struct task_tcb_s *tcb) * It's a common practice to keep 0-2 always open even if they are * /dev/null to avoid that kind of problems. Thus the following warning. */ -#warning file descriptors 0-2 are not opened +# warning file descriptors 0-2 are not opened #endif /* defined(CONFIG_DEV_CONSOLE) || defined(CONFIG_DEV_NULL) */ sched_trace_end(); diff --git a/sched/init/nx_start.c b/sched/init/nx_start.c index 56dd24f785..21da0583f1 100644 --- a/sched/init/nx_start.c +++ b/sched/init/nx_start.c @@ -661,7 +661,7 @@ void nx_start(void) * IDLE task. */ - DEBUGVERIFY(group_setupidlefiles(&g_idletcb[i])); + DEBUGVERIFY(group_setupidlefiles()); } }