You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2023/10/17 14:23:12 UTC
[nuttx] branch master updated: sched: Remove the unused tcb argument from group_setupidlefiles
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new a34be7f7c2 sched: Remove the unused tcb argument from group_setupidlefiles
a34be7f7c2 is described below
commit a34be7f7c252d966d81c4687180bc304cecd6cba
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Oct 15 14:27:39 2023 +0800
sched: Remove the unused tcb argument from group_setupidlefiles
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
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());
}
}