diff --git a/arch b/arch index 0b8c98bfac1..ecb67120352 160000 --- a/arch +++ b/arch @@ -1 +1 @@ -Subproject commit 0b8c98bfac171b330430a02070ecbe8bb9618de3 +Subproject commit ecb67120352a5acc46c6ea06fe882ddfb597824f diff --git a/configs b/configs index 2386155376e..20921ccad2c 160000 --- a/configs +++ b/configs @@ -1 +1 @@ -Subproject commit 2386155376e4ebcbcdcb15b3dfb1e6205f33c54a +Subproject commit 20921ccad2cf456d6828d5d9f4ec8763a5f31f1f diff --git a/sched/clock/clock_abstime2ticks.c b/sched/clock/clock_abstime2ticks.c index a33b2acc1b8..30027d76170 100644 --- a/sched/clock/clock_abstime2ticks.c +++ b/sched/clock/clock_abstime2ticks.c @@ -85,7 +85,7 @@ static long compare_timespec(FAR const struct timespec *a, if (a->tv_sec > b->tv_sec) { return 1; - } + } return (long)a->tv_nsec -(long)b->tv_nsec; } diff --git a/sched/environ/env_clearenv.c b/sched/environ/env_clearenv.c index e45939ce0e5..acfb6b2f46f 100644 --- a/sched/environ/env_clearenv.c +++ b/sched/environ/env_clearenv.c @@ -74,7 +74,7 @@ int clearenv(void) { - FAR struct tcb_s *tcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head; DEBUGASSERT(tcb->group); env_release(tcb->group); diff --git a/sched/environ/env_dup.c b/sched/environ/env_dup.c index 90abc1c98f1..542774f8924 100644 --- a/sched/environ/env_dup.c +++ b/sched/environ/env_dup.c @@ -81,7 +81,7 @@ int env_dup(FAR struct task_group_s *group) { - FAR struct tcb_s *ptcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *ptcb = (FAR struct tcb_s *)g_readytorun.head; FAR char *envp = NULL; size_t envlen; int ret = OK; diff --git a/sched/environ/env_findvar.c b/sched/environ/env_findvar.c index 2112c14118c..2a5b959da73 100644 --- a/sched/environ/env_findvar.c +++ b/sched/environ/env_findvar.c @@ -67,7 +67,7 @@ static bool env_cmpname(const char *pszname, const char *peqname) /* On sucess, pszname will end with '\0' and peqname with '=' */ - if ( *pszname == '\0' && *peqname == '=' ) + if (*pszname == '\0' && *peqname == '=') { return true; } diff --git a/sched/environ/env_getenv.c b/sched/environ/env_getenv.c index 51f886fe0fe..ae1408d045d 100644 --- a/sched/environ/env_getenv.c +++ b/sched/environ/env_getenv.c @@ -94,12 +94,12 @@ FAR char *getenv(const char *name) /* Get a reference to the thread-private environ in the TCB. */ sched_lock(); - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; group = rtcb->group; /* Check if the variable exists */ - if ( !group || (pvar = env_findvar(group, name)) == NULL) + if (!group || (pvar = env_findvar(group, name)) == NULL) { ret = ENOENT; goto errout_with_lock; @@ -130,4 +130,3 @@ errout: } #endif /* CONFIG_DISABLE_ENVIRON */ - diff --git a/sched/environ/env_getenvironptr.c b/sched/environ/env_getenvironptr.c index f56a08a1b00..447fff2b897 100644 --- a/sched/environ/env_getenvironptr.c +++ b/sched/environ/env_getenvironptr.c @@ -71,7 +71,7 @@ * ****************************************************************************/ -FAR char **get_environ_ptr( void ) +FAR char **get_environ_ptr(void) { #if 1 @@ -85,7 +85,7 @@ FAR char **get_environ_ptr( void ) /* Return a reference to the thread-private environ in the TCB. */ - FAR struct tcb_s *ptcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *ptcb = (FAR struct tcb_s *)g_readytorun.head; if (ptcb->envp) { return &ptcb->envp->ev_env; diff --git a/sched/environ/env_putenv.c b/sched/environ/env_putenv.c index aef05fc829e..1d10d798a10 100644 --- a/sched/environ/env_putenv.c +++ b/sched/environ/env_putenv.c @@ -100,7 +100,7 @@ int putenv(FAR const char *string) goto errout; } - pequal = strchr( pname, '='); + pequal = strchr(pname, '='); if (pequal) { /* Then let setenv do all of the work */ diff --git a/sched/environ/env_setenv.c b/sched/environ/env_setenv.c index 92b118cfc8f..250a14c365f 100644 --- a/sched/environ/env_setenv.c +++ b/sched/environ/env_setenv.c @@ -124,7 +124,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite) /* Get a reference to the thread-private environ in the TCB. */ sched_lock(); - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; group = rtcb->group; DEBUGASSERT(group); diff --git a/sched/environ/env_unsetenv.c b/sched/environ/env_unsetenv.c index 013b9e68047..39a87265d98 100644 --- a/sched/environ/env_unsetenv.c +++ b/sched/environ/env_unsetenv.c @@ -77,7 +77,7 @@ int unsetenv(FAR const char *name) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->group; FAR char *pvar; FAR char *newenvp; diff --git a/sched/errno/errno_getptr.c b/sched/errno/errno_getptr.c index 50a753d021d..c24bed5a496 100644 --- a/sched/errno/errno_getptr.c +++ b/sched/errno/errno_getptr.c @@ -101,7 +101,7 @@ FAR int *get_errno_ptr(void) * may be NULL. */ - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; if (rtcb && rtcb->task_state == TSTATE_TASK_RUNNING) { /* Yes.. the task is running normally. Return a reference to the diff --git a/sched/group/group_create.c b/sched/group/group_create.c index edacec04907..683b234400b 100644 --- a/sched/group/group_create.c +++ b/sched/group/group_create.c @@ -115,7 +115,7 @@ static void group_assigngid(FAR struct task_group_s *group) /* Loop until we create a unique ID */ - for (;;) + for (; ; ) { /* Increment the ID counter. This is global data so be extra paranoid. */ diff --git a/sched/group/group_foreachchild.c b/sched/group/group_foreachchild.c index deaeea2cdec..72c1c3b93ea 100644 --- a/sched/group/group_foreachchild.c +++ b/sched/group/group_foreachchild.c @@ -83,11 +83,11 @@ int group_foreachchild(FAR struct task_group_s *group, for (i = 0; i < group->tg_nmembers; i++) { - ret = handler(group->tg_members[i], arg); - if (ret != 0) - { - return ret; - } + ret = handler(group->tg_members[i], arg); + if (ret != 0) + { + return ret; + } } return 0; diff --git a/sched/group/group_leave.c b/sched/group/group_leave.c index 2bc3015e249..276617c2bbc 100644 --- a/sched/group/group_leave.c +++ b/sched/group/group_leave.c @@ -312,7 +312,7 @@ static inline void group_removemember(FAR struct task_group_s *group, pid_t pid) /* Does this member have the matching pid */ if (group->tg_members[i] == pid) - { + { /* Remove the member from the array of members. This must be an * atomic operation because the member array may be accessed from * interrupt handlers (read-only). diff --git a/sched/group/group_setupstreams.c b/sched/group/group_setupstreams.c index 292f0a6fe43..ea57f32fc7d 100644 --- a/sched/group/group_setupstreams.c +++ b/sched/group/group_setupstreams.c @@ -88,9 +88,9 @@ int group_setupstreams(FAR struct task_tcb_s *tcb) * fd = 2 is stderr (write-only, append) */ - (void)fs_fdopen(0, O_RDONLY, (FAR struct tcb_s *)tcb); - (void)fs_fdopen(1, O_WROK|O_CREAT, (FAR struct tcb_s *)tcb); - (void)fs_fdopen(2, O_WROK|O_CREAT, (FAR struct tcb_s *)tcb); + (void)fs_fdopen(0, O_RDONLY, (FAR struct tcb_s *)tcb); + (void)fs_fdopen(1, O_WROK | O_CREAT, (FAR struct tcb_s *)tcb); + (void)fs_fdopen(2, O_WROK | O_CREAT, (FAR struct tcb_s *)tcb); return OK; } diff --git a/sched/group/group_setuptaskfiles.c b/sched/group/group_setuptaskfiles.c index a1db88023f7..c9b08cc9340 100644 --- a/sched/group/group_setuptaskfiles.c +++ b/sched/group/group_setuptaskfiles.c @@ -89,7 +89,7 @@ static inline void sched_dupfiles(FAR struct task_tcb_s *tcb) { /* The parent task is the one at the head of the ready-to-run list */ - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct file *parent; FAR struct file *child; int i; @@ -102,7 +102,7 @@ static inline void sched_dupfiles(FAR struct task_tcb_s *tcb) * accordingly above. */ - /* Get pointers to the parent and child task file lists */ + /* Get pointers to the parent and child task file lists */ parent = rtcb->group->tg_filelist.fl_files; child = tcb->cmn.group->tg_filelist.fl_files; @@ -147,7 +147,7 @@ static inline void sched_dupsockets(FAR struct task_tcb_s *tcb) { /* The parent task is the one at the head of the ready-to-run list */ - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct socket *parent; FAR struct socket *child; int i; diff --git a/sched/init/os_start.c b/sched/init/os_start.c index 29d3bc68f1a..8e5d52cf061 100644 --- a/sched/init/os_start.c +++ b/sched/init/os_start.c @@ -311,7 +311,7 @@ void os_start(void) * that has pid == 0 and sched_priority == 0. */ - bzero((void*)&g_idletcb, sizeof(struct task_tcb_s)); + bzero((void *)&g_idletcb, sizeof(struct task_tcb_s)); g_idletcb.cmn.task_state = TSTATE_TASK_RUNNING; g_idletcb.cmn.entry.main = (main_t)os_start; g_idletcb.cmn.flags = TCB_FLAG_TTYPE_KERNEL; @@ -341,7 +341,7 @@ void os_start(void) /* Then add the idle task's TCB to the head of the ready to run list */ - dq_addfirst((FAR dq_entry_t*)&g_idletcb, (FAR dq_queue_t*)&g_readytorun); + dq_addfirst((FAR dq_entry_t *)&g_idletcb, (FAR dq_queue_t *)&g_readytorun); /* Initialize the processor-specific portion of the TCB */ @@ -550,7 +550,7 @@ void os_start(void) /* When control is return to this point, the system is idle. */ sdbg("Beginning Idle Loop\n"); - for (;;) + for (; ; ) { /* Perform garbage collection (if it is not being done by the worker * thread). This cleans-up memory de-allocations that were queued diff --git a/sched/mqueue/mq_desclose.c b/sched/mqueue/mq_desclose.c index ae0dc1cefe3..ca7bfc5b8a4 100644 --- a/sched/mqueue/mq_desclose.c +++ b/sched/mqueue/mq_desclose.c @@ -105,7 +105,7 @@ void mq_desclose(mqd_t mqdes) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)sched_self(); + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)sched_self(); FAR struct task_group_s *group = rtcb->group; FAR struct mqueue_inode_s *msgq; @@ -115,7 +115,7 @@ void mq_desclose(mqd_t mqdes) * descriptors. */ - sq_rem((FAR sq_entry_t*)mqdes, &group->tg_msgdesq); + sq_rem((FAR sq_entry_t *)mqdes, &group->tg_msgdesq); /* Find the message queue associated with the message descriptor */ @@ -135,8 +135,8 @@ void mq_desclose(mqd_t mqdes) } #endif - /* Deallocate the message descriptor */ + /* Deallocate the message descriptor */ - mq_desfree(mqdes); + mq_desfree(mqdes); } diff --git a/sched/mqueue/mq_descreate.c b/sched/mqueue/mq_descreate.c index f7f2eba5da4..957b52815ce 100644 --- a/sched/mqueue/mq_descreate.c +++ b/sched/mqueue/mq_descreate.c @@ -166,7 +166,7 @@ mqd_t mq_descreate(FAR struct tcb_s *mtcb, FAR struct mqueue_inode_s *msgq, /* And add it to the specified task's TCB */ - sq_addlast((FAR sq_entry_t*)mqdes, &group->tg_msgdesq); + sq_addlast((FAR sq_entry_t *)mqdes, &group->tg_msgdesq); } return mqdes; diff --git a/sched/mqueue/mq_initialize.c b/sched/mqueue/mq_initialize.c index ee54e28ce51..c60fd9038aa 100644 --- a/sched/mqueue/mq_initialize.c +++ b/sched/mqueue/mq_initialize.c @@ -130,7 +130,7 @@ mq_msgblockalloc(FAR sq_queue_t *queue, uint16_t nmsgs, * configured number of messages. */ - mqmsgblock = (FAR struct mqueue_msg_s*) + mqmsgblock = (FAR struct mqueue_msg_s *) kmm_malloc(sizeof(struct mqueue_msg_s) * nmsgs); if (mqmsgblock) @@ -141,7 +141,7 @@ mq_msgblockalloc(FAR sq_queue_t *queue, uint16_t nmsgs, for (i = 0; i < nmsgs; i++) { mqmsg->type = alloc_type; - sq_addlast((FAR sq_entry_t*)mqmsg++, queue); + sq_addlast((FAR sq_entry_t *)mqmsg++, queue); } } @@ -225,13 +225,13 @@ void mq_desblockalloc(void) * we ever need to reclaim the memory. */ - sq_addlast((FAR sq_entry_t*)&mqdesblock->queue, &g_desalloc); + sq_addlast((FAR sq_entry_t *)&mqdesblock->queue, &g_desalloc); /* Then add each message queue descriptor to the free list */ for (i = 0; i < NUM_MSG_DESCRIPTORS; i++) { - sq_addlast((FAR sq_entry_t*)&mqdesblock->mqdes[i], &g_desfree); + sq_addlast((FAR sq_entry_t *)&mqdesblock->mqdes[i], &g_desfree); } } } diff --git a/sched/mqueue/mq_msgfree.c b/sched/mqueue/mq_msgfree.c index 96e9a955469..9d83f7be28d 100644 --- a/sched/mqueue/mq_msgfree.c +++ b/sched/mqueue/mq_msgfree.c @@ -101,7 +101,7 @@ void mq_msgfree(FAR struct mqueue_msg_s *mqmsg) */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)mqmsg, &g_msgfree); + sq_addlast((FAR sq_entry_t *)mqmsg, &g_msgfree); irqrestore(saved_state); } @@ -116,7 +116,7 @@ void mq_msgfree(FAR struct mqueue_msg_s *mqmsg) */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)mqmsg, &g_msgfreeirq); + sq_addlast((FAR sq_entry_t *)mqmsg, &g_msgfreeirq); irqrestore(saved_state); } diff --git a/sched/mqueue/mq_msgqalloc.c b/sched/mqueue/mq_msgqalloc.c index 39c7e04c3ac..6d9ccb05012 100644 --- a/sched/mqueue/mq_msgqalloc.c +++ b/sched/mqueue/mq_msgqalloc.c @@ -109,7 +109,7 @@ FAR struct mqueue_inode_s *mq_msgqalloc(mode_t mode, /* Allocate memory for the new message queue. */ - msgq = (FAR struct mqueue_inode_s*) + msgq = (FAR struct mqueue_inode_s *) kmm_zalloc(sizeof(struct mqueue_inode_s)); if (msgq) diff --git a/sched/mqueue/mq_msgqfree.c b/sched/mqueue/mq_msgqfree.c index 85a591502fc..ac3627898bf 100644 --- a/sched/mqueue/mq_msgqfree.c +++ b/sched/mqueue/mq_msgqfree.c @@ -92,7 +92,7 @@ void mq_msgqfree(FAR struct mqueue_inode_s *msgq) /* Deallocate any stranded messages in the message queue. */ - curr = (FAR struct mqueue_msg_s*)msgq->msglist.head; + curr = (FAR struct mqueue_msg_s *)msgq->msglist.head; while (curr) { /* Deallocate the message structure. */ diff --git a/sched/mqueue/mq_notify.c b/sched/mqueue/mq_notify.c index a9a57c3f07c..c9836715fe7 100644 --- a/sched/mqueue/mq_notify.c +++ b/sched/mqueue/mq_notify.c @@ -149,7 +149,7 @@ int mq_notify(mqd_t mqdes, const struct sigevent *notification) /* Get the current process ID */ - rtcb = (struct tcb_s*)g_readytorun.head; + rtcb = (struct tcb_s *)g_readytorun.head; /* Is there already a notification attached */ diff --git a/sched/mqueue/mq_rcvinternal.c b/sched/mqueue/mq_rcvinternal.c index fa7932f0c2a..bcc7059b864 100644 --- a/sched/mqueue/mq_rcvinternal.c +++ b/sched/mqueue/mq_rcvinternal.c @@ -166,7 +166,7 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) /* Get the message from the head of the queue */ - while ((rcvmsg = (FAR struct mqueue_msg_s*)sq_remfirst(&msgq->msglist)) == NULL) + while ((rcvmsg = (FAR struct mqueue_msg_s *)sq_remfirst(&msgq->msglist)) == NULL) { /* The queue is empty! Should we block until there the above condition * has been satisfied? @@ -176,7 +176,7 @@ FAR struct mqueue_msg_s *mq_waitreceive(mqd_t mqdes) { /* Yes.. Block and try again */ - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; rtcb->msgwaitq = msgq; msgq->nwaitnotempty++; @@ -259,7 +259,7 @@ ssize_t mq_doreceive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, /* Copy the message into the caller's buffer */ - memcpy(ubuffer, (const void*)mqmsg->mail, rcvmsglen); + memcpy(ubuffer, (FAR const void *)mqmsg->mail, rcvmsglen); /* Copy the message priority as well (if a buffer is provided) */ @@ -284,7 +284,7 @@ ssize_t mq_doreceive(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, */ saved_state = irqsave(); - for (btcb = (FAR struct tcb_s*)g_waitingformqnotfull.head; + for (btcb = (FAR struct tcb_s *)g_waitingformqnotfull.head; btcb && btcb->msgwaitq != msgq; btcb = btcb->flink); diff --git a/sched/mqueue/mq_sndinternal.c b/sched/mqueue/mq_sndinternal.c index 3bfb4d9e569..f2a312f8ef8 100644 --- a/sched/mqueue/mq_sndinternal.c +++ b/sched/mqueue/mq_sndinternal.c @@ -174,12 +174,12 @@ FAR struct mqueue_msg_s *mq_msgalloc(void) { /* Try the general free list */ - mqmsg = (FAR struct mqueue_msg_s*)sq_remfirst(&g_msgfree); + mqmsg = (FAR struct mqueue_msg_s *)sq_remfirst(&g_msgfree); if (!mqmsg) { /* Try the free list reserved for interrupt handlers */ - mqmsg = (FAR struct mqueue_msg_s*)sq_remfirst(&g_msgfreeirq); + mqmsg = (FAR struct mqueue_msg_s *)sq_remfirst(&g_msgfreeirq); } } @@ -192,7 +192,7 @@ FAR struct mqueue_msg_s *mq_msgalloc(void) */ saved_state = irqsave(); - mqmsg = (FAR struct mqueue_msg_s*)sq_remfirst(&g_msgfree); + mqmsg = (FAR struct mqueue_msg_s *)sq_remfirst(&g_msgfree); irqrestore(saved_state); /* If we cannot a message from the free list, then we will have to allocate one. */ @@ -278,7 +278,7 @@ int mq_waitsend(mqd_t mqdes) * When we are unblocked, we will try again */ - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; rtcb->msgwaitq = msgq; msgq->nwaitnotfull++; @@ -293,7 +293,7 @@ int mq_waitsend(mqd_t mqdes) if (get_errno() != OK) { - return ERROR; + return ERROR; } } } @@ -346,7 +346,7 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg, /* Copy the message data into the message */ - memcpy((void*)mqmsg->mail, (FAR const void*)msg, msglen); + memcpy((FAR void *)mqmsg->mail, (FAR const void *)msg, msglen); /* Insert the new message in the message queue */ @@ -356,7 +356,7 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg, * message. Each is list is maintained in ascending priority order. */ - for (prev = NULL, next = (FAR struct mqueue_msg_s*)msgq->msglist.head; + for (prev = NULL, next = (FAR struct mqueue_msg_s *)msgq->msglist.head; next && prio <= next->priority; prev = next, next = next->next); @@ -364,12 +364,12 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg, if (prev) { - sq_addafter((FAR sq_entry_t*)prev, (FAR sq_entry_t*)mqmsg, + sq_addafter((FAR sq_entry_t *)prev, (FAR sq_entry_t *)mqmsg, &msgq->msglist); } else { - sq_addfirst((FAR sq_entry_t*)mqmsg, &msgq->msglist); + sq_addfirst((FAR sq_entry_t *)mqmsg, &msgq->msglist); } /* Increment the count of messages in the queue */ @@ -422,7 +422,7 @@ int mq_dosend(mqd_t mqdes, FAR struct mqueue_msg_s *mqmsg, FAR const char *msg, * interrupts should never cause a change in this list */ - for (btcb = (FAR struct tcb_s*)g_waitingformqnotempty.head; + for (btcb = (FAR struct tcb_s *)g_waitingformqnotempty.head; btcb && btcb->msgwaitq != msgq; btcb = btcb->flink); diff --git a/sched/paging/pg_miss.c b/sched/paging/pg_miss.c index 7ebdc16829e..d41821bc4f7 100644 --- a/sched/paging/pg_miss.c +++ b/sched/paging/pg_miss.c @@ -121,7 +121,7 @@ void pg_miss(void) { - FAR struct tcb_s *ftcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *ftcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct tcb_s *wtcb; /* Sanity checking diff --git a/sched/paging/pg_worker.c b/sched/paging/pg_worker.c index 25643dd3a7a..1a661a8af23 100644 --- a/sched/paging/pg_worker.c +++ b/sched/paging/pg_worker.c @@ -249,7 +249,7 @@ static inline bool pg_dequeue(void) { /* Remove the TCB from the head of the list (if any) */ - g_pftcb = (FAR struct tcb_s *)dq_remfirst((dq_queue_t*)&g_waitingforfill); + g_pftcb = (FAR struct tcb_s *)dq_remfirst((dq_queue_t *)&g_waitingforfill); pgllvdbg("g_pftcb: %p\n", g_pftcb); if (g_pftcb != NULL) { @@ -538,7 +538,7 @@ int pg_worker(int argc, char *argv[]) pglldbg("Started\n"); (void)irqsave(); - for (;;) + for (; ; ) { /* Wait awhile. We will wait here until either the configurable timeout * elapses or until we are awakened by a signal (which terminates the @@ -585,7 +585,7 @@ int pg_worker(int argc, char *argv[]) */ pglldbg("Restarting TCB: %p\n", g_pftcb); - up_unblock_task(g_pftcb);; + up_unblock_task(g_pftcb); /* Yes .. Start the next asynchronous fill. Check the return * value to see a fill was actually started (false means that @@ -638,7 +638,7 @@ int pg_worker(int argc, char *argv[]) * pending fills have been processed. */ - for (;;) + for (; ; ) { /* Yes .. Start the fill and block until the fill completes. * Check the return value to see a fill was actually performed. @@ -648,9 +648,9 @@ int pg_worker(int argc, char *argv[]) pgllvdbg("Calling pg_startfill\n"); if (!pg_startfill()) { - /* Break out of the loop -- there is nothing more to do */ + /* Break out of the loop -- there is nothing more to do */ - break; + break; } /* Handle the page fill complete event by restarting the @@ -661,7 +661,7 @@ int pg_worker(int argc, char *argv[]) */ pgllvdbg("Restarting TCB: %p\n", g_pftcb); - up_unblock_task(g_pftcb);; + up_unblock_task(g_pftcb); } /* All queued fills have been processed */ diff --git a/sched/pthread/pthread_cancel.c b/sched/pthread/pthread_cancel.c index 60c2ba6585a..8892dc6a435 100644 --- a/sched/pthread/pthread_cancel.c +++ b/sched/pthread/pthread_cancel.c @@ -132,7 +132,7 @@ int pthread_cancel(pthread_t thread) * same as pthread_exit(PTHREAD_CANCELED). */ - if (tcb == (struct tcb_s*)g_readytorun.head) + if (tcb == (struct tcb_s *)g_readytorun.head) { pthread_exit(PTHREAD_CANCELED); } diff --git a/sched/pthread/pthread_condbroadcast.c b/sched/pthread/pthread_condbroadcast.c index 98aa73f3633..812b701ea9a 100644 --- a/sched/pthread/pthread_condbroadcast.c +++ b/sched/pthread/pthread_condbroadcast.c @@ -108,7 +108,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond) /* Get the current value of the semaphore */ - if (sem_getvalue((sem_t*)&cond->sem, &sval) != OK) + if (sem_getvalue((FAR sem_t *)&cond->sem, &sval) != OK) { ret = EINVAL; } @@ -123,7 +123,7 @@ int pthread_cond_broadcast(FAR pthread_cond_t *cond) * Only the highest priority waiting thread will get to execute */ - ret = pthread_givesemaphore((sem_t*)&cond->sem); + ret = pthread_givesemaphore((FAR sem_t *)&cond->sem); /* Increment the semaphore count (as was done by the * above post). diff --git a/sched/pthread/pthread_conddestroy.c b/sched/pthread/pthread_conddestroy.c index 5cb5823ad41..2584e8dbaee 100644 --- a/sched/pthread/pthread_conddestroy.c +++ b/sched/pthread/pthread_conddestroy.c @@ -75,9 +75,9 @@ int pthread_cond_destroy(FAR pthread_cond_t *cond) ret = EINVAL; } - /* Destroy the semaphore contained in the structure */ + /* Destroy the semaphore contained in the structure */ - else if (sem_destroy((sem_t*)&cond->sem) != OK) + else if (sem_destroy((FAR sem_t *)&cond->sem) != OK) { ret = EINVAL; } diff --git a/sched/pthread/pthread_condinit.c b/sched/pthread/pthread_condinit.c index 56718402334..a73811e0782 100644 --- a/sched/pthread/pthread_condinit.c +++ b/sched/pthread/pthread_condinit.c @@ -80,7 +80,7 @@ int pthread_cond_init(FAR pthread_cond_t *cond, FAR const pthread_condattr_t *at * with initial count = 0 */ - else if (sem_init((sem_t*)&cond->sem, 0, 0) != OK) + else if (sem_init((FAR sem_t *)&cond->sem, 0, 0) != OK) { ret = EINVAL; } diff --git a/sched/pthread/pthread_condsignal.c b/sched/pthread/pthread_condsignal.c index 85d020bc314..e6b30adac59 100644 --- a/sched/pthread/pthread_condsignal.c +++ b/sched/pthread/pthread_condsignal.c @@ -100,7 +100,7 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) { /* Get the current value of the semaphore */ - if (sem_getvalue((sem_t*)&cond->sem, &sval) != OK) + if (sem_getvalue((FAR sem_t *)&cond->sem, &sval) != OK) { ret = EINVAL; } @@ -125,7 +125,7 @@ int pthread_cond_signal(FAR pthread_cond_t *cond) if (sval < 0) { sdbg("Signalling...\n"); - ret = pthread_givesemaphore((sem_t*)&cond->sem); + ret = pthread_givesemaphore((FAR sem_t *)&cond->sem); } } } diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c index 6e9fa60dec6..9a02ef912a7 100644 --- a/sched/pthread/pthread_condtimedwait.c +++ b/sched/pthread/pthread_condtimedwait.c @@ -272,7 +272,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, /* Give up the mutex */ mutex->pid = -1; - ret = pthread_givesemaphore((sem_t*)&mutex->sem); + ret = pthread_givesemaphore((FAR sem_t *)&mutex->sem); if (ret) { /* Restore interrupts (pre-emption will be enabled when @@ -294,7 +294,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, * are started atomically. */ - status = sem_wait((sem_t*)&cond->sem); + status = sem_wait((FAR sem_t *)&cond->sem); /* Did we get the condition semaphore. */ @@ -328,7 +328,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, /* Reacquire the mutex (retaining the ret). */ sdbg("Re-locking...\n"); - status = pthread_takesemaphore((sem_t*)&mutex->sem); + status = pthread_takesemaphore((FAR sem_t *)&mutex->sem); if (!status) { mutex->pid = mypid; diff --git a/sched/pthread/pthread_condwait.c b/sched/pthread/pthread_condwait.c index 5c907ceac94..ab858958070 100644 --- a/sched/pthread/pthread_condwait.c +++ b/sched/pthread/pthread_condwait.c @@ -114,17 +114,17 @@ int pthread_cond_wait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex) sched_lock(); mutex->pid = -1; - ret = pthread_givesemaphore((sem_t*)&mutex->sem); + ret = pthread_givesemaphore((FAR sem_t *)&mutex->sem); /* Take the semaphore */ - ret |= pthread_takesemaphore((sem_t*)&cond->sem); + ret |= pthread_takesemaphore((FAR sem_t *)&cond->sem); sched_unlock(); /* Reacquire the mutex */ sdbg("Reacquire mutex...\n"); - ret |= pthread_takesemaphore((sem_t*)&mutex->sem); + ret |= pthread_takesemaphore((FAR sem_t *)&mutex->sem); if (!ret) { mutex->pid = getpid(); diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index b5df6364c70..c22cead9a91 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -165,9 +165,9 @@ static inline void pthread_addjoininfo(FAR struct task_group_s *group, static void pthread_start(void) { - FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s*)g_readytorun.head; + FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)g_readytorun.head; FAR struct task_group_s *group = ptcb->cmn.group; - FAR struct join_s *pjoin = (FAR struct join_s*)ptcb->joininfo; + FAR struct join_s *pjoin = (FAR struct join_s *)ptcb->joininfo; pthread_addr_t exit_status; DEBUGASSERT(group && pjoin); @@ -280,7 +280,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, /* Allocate a detachable structure to support pthread_join logic */ - pjoin = (FAR struct join_s*)kmm_zalloc(sizeof(struct join_s)); + pjoin = (FAR struct join_s *)kmm_zalloc(sizeof(struct join_s)); if (!pjoin) { sdbg("ERROR: Failed to allocate join\n"); @@ -509,7 +509,7 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr, else { sched_unlock(); - dq_rem((FAR dq_entry_t*)ptcb, (dq_queue_t*)&g_inactivetasks); + dq_rem((FAR dq_entry_t *)ptcb, (FAR dq_queue_t *)&g_inactivetasks); (void)sem_destroy(&pjoin->data_sem); (void)sem_destroy(&pjoin->exit_sem); diff --git a/sched/pthread/pthread_exit.c b/sched/pthread/pthread_exit.c index 6a8e2463a2c..1fda5c27555 100644 --- a/sched/pthread/pthread_exit.c +++ b/sched/pthread/pthread_exit.c @@ -95,7 +95,7 @@ void pthread_exit(FAR void *exit_value) { - struct tcb_s *tcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *tcb = (struct tcb_s *)g_readytorun.head; int status; sdbg("exit_value=%p\n", exit_value); diff --git a/sched/pthread/pthread_getspecific.c b/sched/pthread/pthread_getspecific.c index 34435a2ef41..8a470455f0d 100644 --- a/sched/pthread/pthread_getspecific.c +++ b/sched/pthread/pthread_getspecific.c @@ -104,7 +104,7 @@ FAR void *pthread_getspecific(pthread_key_t key) { #if CONFIG_NPTHREAD_KEYS > 0 - FAR struct pthread_tcb_s *rtcb = (FAR struct pthread_tcb_s*)g_readytorun.head; + FAR struct pthread_tcb_s *rtcb = (FAR struct pthread_tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->cmn.group; FAR void *ret = NULL; diff --git a/sched/pthread/pthread_keycreate.c b/sched/pthread/pthread_keycreate.c index 68af593a63c..03d8486b480 100644 --- a/sched/pthread/pthread_keycreate.c +++ b/sched/pthread/pthread_keycreate.c @@ -108,10 +108,11 @@ * ****************************************************************************/ -int pthread_key_create(FAR pthread_key_t *key, CODE void (*destructor)(void*)) +int pthread_key_create(FAR pthread_key_t *key, + CODE void (*destructor)(FAR void *)) { #if CONFIG_NPTHREAD_KEYS > 0 - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->group; int ret = EAGAIN; diff --git a/sched/pthread/pthread_mutexdestroy.c b/sched/pthread/pthread_mutexdestroy.c index 04e2b37835c..95fc8abef15 100644 --- a/sched/pthread/pthread_mutexdestroy.c +++ b/sched/pthread/pthread_mutexdestroy.c @@ -116,7 +116,7 @@ int pthread_mutex_destroy(FAR pthread_mutex_t *mutex) { /* Destroy the semaphore */ - status = sem_destroy((sem_t*)&mutex->sem); + status = sem_destroy((FAR sem_t *)&mutex->sem); if (status != OK) { ret = EINVAL; diff --git a/sched/pthread/pthread_mutexinit.c b/sched/pthread/pthread_mutexinit.c index 7bba3ae6a41..9ed0b6ecb8a 100644 --- a/sched/pthread/pthread_mutexinit.c +++ b/sched/pthread/pthread_mutexinit.c @@ -119,7 +119,7 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR const pthread_mutexattr_t /* Initialize the mutex like a semaphore with initial count = 1 */ - status = sem_init((sem_t*)&mutex->sem, pshared, 1); + status = sem_init((FAR sem_t *)&mutex->sem, pshared, 1); if (status != OK) { ret = EINVAL; diff --git a/sched/pthread/pthread_mutexlock.c b/sched/pthread/pthread_mutexlock.c index d1bce84e67b..0ff12ab512a 100644 --- a/sched/pthread/pthread_mutexlock.c +++ b/sched/pthread/pthread_mutexlock.c @@ -168,7 +168,7 @@ int pthread_mutex_lock(FAR pthread_mutex_t *mutex) { /* Take the semaphore */ - ret = pthread_takesemaphore((sem_t*)&mutex->sem); + ret = pthread_takesemaphore((FAR sem_t *)&mutex->sem); /* If we succussfully obtained the semaphore, then indicate * that we own it. diff --git a/sched/pthread/pthread_mutextrylock.c b/sched/pthread/pthread_mutextrylock.c index 0591ecf25d6..d7b182c875c 100644 --- a/sched/pthread/pthread_mutextrylock.c +++ b/sched/pthread/pthread_mutextrylock.c @@ -123,7 +123,7 @@ int pthread_mutex_trylock(FAR pthread_mutex_t *mutex) /* Try to get the semaphore. */ - if (sem_trywait((sem_t*)&mutex->sem) == OK) + if (sem_trywait((FAR sem_t *)&mutex->sem) == OK) { /* If we successfully obtained the semaphore, then indicate * that we own it. diff --git a/sched/pthread/pthread_mutexunlock.c b/sched/pthread/pthread_mutexunlock.c index 55ffa8b9f08..5ec784b8cc9 100644 --- a/sched/pthread/pthread_mutexunlock.c +++ b/sched/pthread/pthread_mutexunlock.c @@ -152,7 +152,7 @@ int pthread_mutex_unlock(FAR pthread_mutex_t *mutex) #ifdef CONFIG_MUTEX_TYPES mutex->nlocks = 0; #endif - ret = pthread_givesemaphore((sem_t*)&mutex->sem); + ret = pthread_givesemaphore((FAR sem_t *)&mutex->sem); } sched_unlock(); } diff --git a/sched/pthread/pthread_setcancelstate.c b/sched/pthread/pthread_setcancelstate.c index b898c211f0c..4d4ba360f99 100644 --- a/sched/pthread/pthread_setcancelstate.c +++ b/sched/pthread/pthread_setcancelstate.c @@ -75,7 +75,7 @@ int pthread_setcancelstate(int state, FAR int *oldstate) { - struct tcb_s *tcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *tcb = (struct tcb_s *)g_readytorun.head; int ret = OK; /* Suppress context changes for a bit so that the flags are stable. (the @@ -106,7 +106,7 @@ int pthread_setcancelstate(int state, FAR int *oldstate) /* Clear the non-cancelable and cancel pending flags */ - tcb->flags &= ~(TCB_FLAG_NONCANCELABLE|TCB_FLAG_CANCEL_PENDING); + tcb->flags &= ~(TCB_FLAG_NONCANCELABLE | TCB_FLAG_CANCEL_PENDING); /* If the cancel was pending, then just exit as requested */ diff --git a/sched/pthread/pthread_setspecific.c b/sched/pthread/pthread_setspecific.c index 9b7e382adac..a91dc5e137a 100644 --- a/sched/pthread/pthread_setspecific.c +++ b/sched/pthread/pthread_setspecific.c @@ -115,7 +115,7 @@ int pthread_setspecific(pthread_key_t key, FAR const void *value) { #if CONFIG_NPTHREAD_KEYS > 0 - FAR struct pthread_tcb_s *rtcb = (FAR struct pthread_tcb_s*)g_readytorun.head; + FAR struct pthread_tcb_s *rtcb = (FAR struct pthread_tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->cmn.group; int ret = EINVAL; @@ -128,7 +128,7 @@ int pthread_setspecific(pthread_key_t key, FAR const void *value) { /* Store the data in the TCB. */ - rtcb->pthread_data[key] = (FAR void*)value; + rtcb->pthread_data[key] = (FAR void *)value; /* Return success. */ diff --git a/sched/sched/sched_addblocked.c b/sched/sched/sched_addblocked.c index 87915f624b5..05a87424319 100644 --- a/sched/sched/sched_addblocked.c +++ b/sched/sched/sched_addblocked.c @@ -105,14 +105,14 @@ void sched_addblocked(FAR struct tcb_s *btcb, tstate_t task_state) /* Add the task to a prioritized list */ sched_addprioritized(btcb, - (FAR dq_queue_t*)g_tasklisttable[task_state].list); + (FAR dq_queue_t *)g_tasklisttable[task_state].list); } else { /* Add the task to a non-prioritized list */ - dq_addlast((FAR dq_entry_t*)btcb, - (FAR dq_queue_t*)g_tasklisttable[task_state].list); + dq_addlast((FAR dq_entry_t *)btcb, + (FAR dq_queue_t *)g_tasklisttable[task_state].list); } /* Make sure the TCB's state corresponds to the list */ diff --git a/sched/sched/sched_addprioritized.c b/sched/sched/sched_addprioritized.c index babb31ef0d4..3eff24b82c5 100644 --- a/sched/sched/sched_addprioritized.c +++ b/sched/sched/sched_addprioritized.c @@ -110,7 +110,7 @@ bool sched_addprioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list) * Each is list is maintained in ascending sched_priority order. */ - for (next = (FAR struct tcb_s*)list->head; + for (next = (FAR struct tcb_s *)list->head; (next && sched_priority <= next->sched_priority); next = next->flink); @@ -123,15 +123,15 @@ bool sched_addprioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list) { /* The tcb goes at the end of the list. */ - prev = (FAR struct tcb_s*)list->tail; + prev = (FAR struct tcb_s *)list->tail; if (!prev) { /* Special case: The list is empty */ tcb->flink = NULL; tcb->blink = NULL; - list->head = (FAR dq_entry_t*)tcb; - list->tail = (FAR dq_entry_t*)tcb; + list->head = (FAR dq_entry_t *)tcb; + list->tail = (FAR dq_entry_t *)tcb; ret = true; } else @@ -141,14 +141,14 @@ bool sched_addprioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list) tcb->flink = NULL; tcb->blink = prev; prev->flink = tcb; - list->tail = (FAR dq_entry_t*)tcb; + list->tail = (FAR dq_entry_t *)tcb; } } else { /* The tcb goes just before next */ - prev = (FAR struct tcb_s*)next->blink; + prev = (FAR struct tcb_s *)next->blink; if (!prev) { /* Special case: Insert at the head of the list */ @@ -156,7 +156,7 @@ bool sched_addprioritized(FAR struct tcb_s *tcb, DSEG dq_queue_t *list) tcb->flink = next; tcb->blink = NULL; next->blink = tcb; - list->head = (FAR dq_entry_t*)tcb; + list->head = (FAR dq_entry_t *)tcb; ret = true; } else diff --git a/sched/sched/sched_addreadytorun.c b/sched/sched/sched_addreadytorun.c index 129f78c75ea..2ebfcc49fef 100644 --- a/sched/sched/sched_addreadytorun.c +++ b/sched/sched/sched_addreadytorun.c @@ -100,7 +100,7 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; bool ret; /* Check if pre-emption is disabled for the current running task and if @@ -114,14 +114,14 @@ bool sched_addreadytorun(FAR struct tcb_s *btcb) * g_pendingtasks task list for now. */ - sched_addprioritized(btcb, (FAR dq_queue_t*)&g_pendingtasks); + sched_addprioritized(btcb, (FAR dq_queue_t *)&g_pendingtasks); btcb->task_state = TSTATE_TASK_PENDING; ret = false; } /* Otherwise, add the new task to the ready-to-run task list */ - else if (sched_addprioritized(btcb, (FAR dq_queue_t*)&g_readytorun)) + else if (sched_addprioritized(btcb, (FAR dq_queue_t *)&g_readytorun)) { /* Inform the instrumentation logic that we are switching tasks */ diff --git a/sched/sched/sched_cpuload.c b/sched/sched/sched_cpuload.c index aa84ee9603b..2cbef4c7397 100644 --- a/sched/sched/sched_cpuload.c +++ b/sched/sched/sched_cpuload.c @@ -111,7 +111,7 @@ volatile uint32_t g_cpuload_total; void weak_function sched_process_cpuload(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; int hash_index; int i; diff --git a/sched/sched/sched_foreach.c b/sched/sched/sched_foreach.c index 64ac8099966..ecd7437d133 100644 --- a/sched/sched/sched_foreach.c +++ b/sched/sched/sched_foreach.c @@ -72,10 +72,10 @@ void sched_foreach(sched_foreach_t handler, FAR void *arg) for (ndx = 0; ndx < CONFIG_MAX_TASKS; ndx++) { - if (g_pidhash[ndx].tcb) - { - handler(g_pidhash[ndx].tcb, arg); - } + if (g_pidhash[ndx].tcb) + { + handler(g_pidhash[ndx].tcb, arg); + } } irqrestore(flags); diff --git a/sched/sched/sched_free.c b/sched/sched/sched_free.c index 210c4673402..e642a57921d 100644 --- a/sched/sched/sched_free.c +++ b/sched/sched/sched_free.c @@ -127,7 +127,8 @@ void sched_ufree(FAR void *address) /* Delay the deallocation until a more appropriate time. */ - sq_addlast((FAR sq_entry_t*)address, (sq_queue_t*)&g_delayed_kufree); + sq_addlast((FAR sq_entry_t *)address, + (FAR sq_queue_t *)&g_delayed_kufree); /* Signal the worker thread that is has some clean up to do */ @@ -167,7 +168,8 @@ void sched_kfree(FAR void *address) /* Delay the deallocation until a more appropriate time. */ - sq_addlast((FAR sq_entry_t*)address, (sq_queue_t*)&g_delayed_kfree); + sq_addlast((FAR sq_entry_t *)address, + (FAR sq_queue_t *)&g_delayed_kfree); /* Signal the worker thread that is has some clean up to do */ diff --git a/sched/sched/sched_garbage.c b/sched/sched/sched_garbage.c index 2edaafc7dbc..f51a442caf3 100644 --- a/sched/sched/sched_garbage.c +++ b/sched/sched/sched_garbage.c @@ -91,18 +91,18 @@ static inline void sched_kucleanup(void) irqstate_t flags; FAR void *address; - /* Test if the delayed deallocation queue is empty. No special protection - * is needed because this is an atomic test. - */ + /* Test if the delayed deallocation queue is empty. No special protection + * is needed because this is an atomic test. + */ - while (g_delayed_kufree.head) + while (g_delayed_kufree.head) { /* Remove the first delayed deallocation. This is not atomic and so * we must disable interrupts around the queue operation. */ flags = irqsave(); - address = (FAR void*)sq_remfirst((FAR sq_queue_t*)&g_delayed_kufree); + address = (FAR void *)sq_remfirst((FAR sq_queue_t *)&g_delayed_kufree); irqrestore(flags); /* The address should always be non-NULL since that was checked in the @@ -137,21 +137,21 @@ static inline void sched_kucleanup(void) defined(CONFIG_MM_KERNEL_HEAP) static inline void sched_kcleanup(void) { - irqstate_t flags; - FAR void *address; + irqstate_t flags; + FAR void *address; - /* Test if the delayed deallocation queue is empty. No special protection - * is needed because this is an atomic test. - */ + /* Test if the delayed deallocation queue is empty. No special protection + * is needed because this is an atomic test. + */ - while (g_delayed_kfree.head) + while (g_delayed_kfree.head) { /* Remove the first delayed deallocation. This is not atomic and so * we must disable interrupts around the queue operation. */ flags = irqsave(); - address = (FAR void*)sq_remfirst((FAR sq_queue_t*)&g_delayed_kfree); + address = (FAR void *)sq_remfirst((FAR sq_queue_t *)&g_delayed_kfree); irqrestore(flags); /* The address should always be non-NULL since that was checked in the diff --git a/sched/sched/sched_getfiles.c b/sched/sched/sched_getfiles.c index 685f9a44ab2..f0608a465d9 100644 --- a/sched/sched/sched_getfiles.c +++ b/sched/sched/sched_getfiles.c @@ -69,7 +69,7 @@ FAR struct filelist *sched_getfiles(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->group; /* The group may be NULL under certain conditions. For example, if diff --git a/sched/sched/sched_getparam.c b/sched/sched/sched_getparam.c index 93794b7eecf..44f9e885fa4 100644 --- a/sched/sched/sched_getparam.c +++ b/sched/sched/sched_getparam.c @@ -110,12 +110,12 @@ int sched_getparam (pid_t pid, FAR struct sched_param *param) /* Check if the task to restart is the calling task */ - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; if ((pid == 0) || (pid == rtcb->pid)) { - /* Return the priority if the calling task. */ + /* Return the priority if the calling task. */ - param->sched_priority = (int)rtcb->sched_priority; + param->sched_priority = (int)rtcb->sched_priority; } /* Ths pid is not for the calling task, we will have to look it up */ diff --git a/sched/sched/sched_getscheduler.c b/sched/sched/sched_getscheduler.c index 8c4bb9de43c..dfbb0e28184 100644 --- a/sched/sched/sched_getscheduler.c +++ b/sched/sched/sched_getscheduler.c @@ -107,7 +107,7 @@ int sched_getscheduler(pid_t pid) if (!pid) { - tcb = (struct tcb_s*)g_readytorun.head; + tcb = (struct tcb_s *)g_readytorun.head; } else { diff --git a/sched/sched/sched_getsockets.c b/sched/sched/sched_getsockets.c index 372f4eeaee4..b292cd38ed7 100644 --- a/sched/sched/sched_getsockets.c +++ b/sched/sched/sched_getsockets.c @@ -70,7 +70,7 @@ FAR struct socketlist *sched_getsockets(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->group; DEBUGASSERT(group); diff --git a/sched/sched/sched_getstreams.c b/sched/sched/sched_getstreams.c index a87c95306c8..29f3074b7a1 100644 --- a/sched/sched/sched_getstreams.c +++ b/sched/sched/sched_getstreams.c @@ -69,7 +69,7 @@ FAR struct streamlist *sched_getstreams(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = rtcb->group; DEBUGASSERT(group); diff --git a/sched/sched/sched_gettcb.c b/sched/sched/sched_gettcb.c index 174af730ac5..83de9358c74 100644 --- a/sched/sched/sched_gettcb.c +++ b/sched/sched/sched_gettcb.c @@ -84,7 +84,7 @@ FAR struct tcb_s *sched_gettcb(pid_t pid) /* Verify that the PID is within range */ - if (pid >= 0 ) + if (pid >= 0) { /* Get the hash_ndx associated with the pid */ diff --git a/sched/sched/sched_lock.c b/sched/sched/sched_lock.c index 7c1e28a5001..b01134d5c76 100644 --- a/sched/sched/sched_lock.c +++ b/sched/sched/sched_lock.c @@ -93,7 +93,7 @@ int sched_lock(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; /* Check for some special cases: (1) rtcb may be NULL only during * early boot-up phases, and (2) sched_lock() should have no diff --git a/sched/sched/sched_lockcount.c b/sched/sched/sched_lockcount.c index 355f08d902d..b7f7730a73e 100644 --- a/sched/sched/sched_lockcount.c +++ b/sched/sched/sched_lockcount.c @@ -91,7 +91,7 @@ int sched_lockcount(void) { - struct tcb_s *rtcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *rtcb = (struct tcb_s *)g_readytorun.head; return (int)rtcb->lockcount; } diff --git a/sched/sched/sched_mergepending.c b/sched/sched/sched_mergepending.c index 1a172f91505..b5028e20080 100644 --- a/sched/sched/sched_mergepending.c +++ b/sched/sched/sched_mergepending.c @@ -102,11 +102,11 @@ bool sched_mergepending(void) /* Initialize the inner search loop */ - rtrtcb = (FAR struct tcb_s*)g_readytorun.head; + rtrtcb = (FAR struct tcb_s *)g_readytorun.head; /* Process every TCB in the g_pendingtasks list */ - for (pndtcb = (FAR struct tcb_s*)g_pendingtasks.head; pndtcb; pndtcb = pndnext) + for (pndtcb = (FAR struct tcb_s *)g_pendingtasks.head; pndtcb; pndtcb = pndnext) { pndnext = pndtcb->flink; @@ -142,7 +142,7 @@ bool sched_mergepending(void) pndtcb->flink = rtrtcb; pndtcb->blink = NULL; rtrtcb->blink = pndtcb; - g_readytorun.head = (FAR dq_entry_t*)pndtcb; + g_readytorun.head = (FAR dq_entry_t *)pndtcb; rtrtcb->task_state = TSTATE_TASK_READYTORUN; pndtcb->task_state = TSTATE_TASK_RUNNING; ret = true; diff --git a/sched/sched/sched_processtimer.c b/sched/sched/sched_processtimer.c index 648ea800b3f..4a7b246434f 100644 --- a/sched/sched/sched_processtimer.c +++ b/sched/sched/sched_processtimer.c @@ -92,7 +92,7 @@ #if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) static inline void sched_process_scheduler(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; #if CONFIG_RR_INTERVAL > 0 /* Check if the currently executing task uses round robin scheduling. */ diff --git a/sched/sched/sched_releasetcb.c b/sched/sched/sched_releasetcb.c index aebf546630e..b7046aa790a 100644 --- a/sched/sched/sched_releasetcb.c +++ b/sched/sched/sched_releasetcb.c @@ -124,7 +124,7 @@ int sched_releasetcb(FAR struct tcb_s *tcb, uint8_t ttype) */ #ifdef CONFIG_HAVE_WEAKFUNCTIONS - if (timer_deleteall != NULL) + if (timer_deleteall != NULL) #endif { timer_deleteall(tcb->pid); diff --git a/sched/sched/sched_removeblocked.c b/sched/sched/sched_removeblocked.c index e09958b848c..7b6b983b044 100644 --- a/sched/sched/sched_removeblocked.c +++ b/sched/sched/sched_removeblocked.c @@ -100,7 +100,8 @@ void sched_removeblocked(FAR struct tcb_s *btcb) * with this state */ - dq_rem((FAR dq_entry_t*)btcb, (dq_queue_t*)g_tasklisttable[task_state].list); + dq_rem((FAR dq_entry_t *)btcb, + (FAR dq_queue_t *)g_tasklisttable[task_state].list); /* Make sure the TCB's state corresponds to not being in * any list diff --git a/sched/sched/sched_reprioritize.c b/sched/sched/sched_reprioritize.c index e6ac01e58ce..b9bff17f36a 100644 --- a/sched/sched/sched_reprioritize.c +++ b/sched/sched/sched_reprioritize.c @@ -112,16 +112,16 @@ int sched_reprioritize(FAR struct tcb_s *tcb, int sched_priority) int ret = sched_setpriority(tcb, sched_priority); if (ret == 0) { - /* Reset the base_priority -- the priority that the thread would return - * to once it posts the semaphore. - */ + /* Reset the base_priority -- the priority that the thread would return + * to once it posts the semaphore. + */ - tcb->base_priority = (uint8_t)sched_priority; + tcb->base_priority = (uint8_t)sched_priority; - /* Discard any pending reprioritizations as well */ + /* Discard any pending reprioritizations as well */ #if CONFIG_SEM_NNESTPRIO > 0 - tcb->npend_reprio = 0; + tcb->npend_reprio = 0; #endif } diff --git a/sched/sched/sched_rrgetinterval.c b/sched/sched/sched_rrgetinterval.c index 8c54ab00f53..5347f641661 100644 --- a/sched/sched/sched_rrgetinterval.c +++ b/sched/sched/sched_rrgetinterval.c @@ -91,7 +91,7 @@ int sched_rr_get_interval(pid_t pid, struct timespec *interval) if (!pid) { - rrtcb = (FAR struct tcb_s*)g_readytorun.head; + rrtcb = (FAR struct tcb_s *)g_readytorun.head; } /* Return a special error code on invalid PID */ diff --git a/sched/sched/sched_self.c b/sched/sched/sched_self.c index 9dda2161b8f..6302aa2208a 100644 --- a/sched/sched/sched_self.c +++ b/sched/sched/sched_self.c @@ -77,7 +77,7 @@ FAR struct tcb_s *sched_self(void) { - return (FAR struct tcb_s*)g_readytorun.head; + return (FAR struct tcb_s *)g_readytorun.head; } diff --git a/sched/sched/sched_setparam.c b/sched/sched/sched_setparam.c index fa355c884ae..cadda71bd3f 100644 --- a/sched/sched/sched_setparam.c +++ b/sched/sched/sched_setparam.c @@ -106,7 +106,7 @@ int sched_setparam(pid_t pid, FAR const struct sched_param *param) /* Check if the task to reprioritize is the calling task */ - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; if (pid == 0 || pid == rtcb->pid) { tcb = rtcb; diff --git a/sched/sched/sched_setpriority.c b/sched/sched/sched_setpriority.c index 191b972f2c1..abb660cb3cf 100644 --- a/sched/sched/sched_setpriority.c +++ b/sched/sched/sched_setpriority.c @@ -103,7 +103,7 @@ int sched_setpriority(FAR struct tcb_s *tcb, int sched_priority) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; tstate_t task_state; irqstate_t saved_state; @@ -204,7 +204,8 @@ int sched_setpriority(FAR struct tcb_s *tcb, int sched_priority) { /* Remove the TCB from the prioritized task list */ - dq_rem((FAR dq_entry_t*)tcb, (FAR dq_queue_t*)g_tasklisttable[task_state].list); + dq_rem((FAR dq_entry_t *)tcb, + (FAR dq_queue_t *)g_tasklisttable[task_state].list); /* Change the task priority */ @@ -214,7 +215,8 @@ int sched_setpriority(FAR struct tcb_s *tcb, int sched_priority) * position */ - sched_addprioritized(tcb, (FAR dq_queue_t*)g_tasklisttable[task_state].list); + sched_addprioritized(tcb, + (FAR dq_queue_t *)g_tasklisttable[task_state].list); } /* CASE 3b. The task resides in a non-prioritized list. */ diff --git a/sched/sched/sched_setscheduler.c b/sched/sched/sched_setscheduler.c index 841d9eb1659..d3650374bb8 100644 --- a/sched/sched/sched_setscheduler.c +++ b/sched/sched/sched_setscheduler.c @@ -109,7 +109,7 @@ int sched_setscheduler(pid_t pid, int policy, /* Check if the task to modify the calling task */ - if (pid == 0 ) + if (pid == 0) { pid = getpid(); } diff --git a/sched/sched/sched_sporadic.c b/sched/sched/sched_sporadic.c index afd3325de51..7cfa152b093 100644 --- a/sched/sched/sched_sporadic.c +++ b/sched/sched/sched_sporadic.c @@ -768,16 +768,16 @@ int sched_sporadic_initialize(FAR struct tcb_s *tcb) * sporadic scheduling parameters and state data. */ - sporadic = (FAR struct sporadic_s *)kmm_zalloc(sizeof(struct sporadic_s)); - if (sporadic == NULL) - { - slldbg("ERROR: Failed to allocate sporadic data structure\n"); - return -ENOMEM; - } + sporadic = (FAR struct sporadic_s *)kmm_zalloc(sizeof(struct sporadic_s)); + if (sporadic == NULL) + { + slldbg("ERROR: Failed to allocate sporadic data structure\n"); + return -ENOMEM; + } - /* The initialize required is to set the back pointer to the TCB in - * each of the replenishment structures. - */ + /* The initialize required is to set the back pointer to the TCB in + * each of the replenishment structures. + */ for (i = 0; i < CONFIG_SCHED_SPORADIC_MAXREPL; i++) { @@ -1145,7 +1145,7 @@ int sched_sporadic_suspend(FAR struct tcb_s *tcb) * * Input Parameters: * tcb - The TCB of the thread that is beginning sporadic - scheduling. + * scheduling. * ticks - The number of elapsed ticks since the last time this * function was called. * noswitches - We are running in a context where context switching is diff --git a/sched/sched/sched_timerexpiration.c b/sched/sched/sched_timerexpiration.c index 76d5a1de28d..41b12c40222 100644 --- a/sched/sched/sched_timerexpiration.c +++ b/sched/sched/sched_timerexpiration.c @@ -164,8 +164,8 @@ static struct timespec g_stop_time; #if CONFIG_RR_INTERVAL > 0 || defined(CONFIG_SCHED_SPORADIC) static inline uint32_t sched_process_scheduler(uint32_t ticks, bool noswitches) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; - FAR struct tcb_s *ntcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; + FAR struct tcb_s *ntcb = (FAR struct tcb_s *)g_readytorun.head; uint32_t ret = 0; #if CONFIG_RR_INTERVAL > 0 @@ -212,15 +212,15 @@ static inline uint32_t sched_process_scheduler(uint32_t ticks, bool noswitches) * the new task at the head of the ready to run list. */ - ntcb = (FAR struct tcb_s*)g_readytorun.head; + ntcb = (FAR struct tcb_s *)g_readytorun.head; /* Check if the new task at the head of the ready-to-run has changed. */ if (rtcb != ntcb) { - /* Recurse just to get the correct return value */ + /* Recurse just to get the correct return value */ - return sched_process_scheduler(0, true); + return sched_process_scheduler(0, true); } /* Returning zero means that there is no interesting event to be timed */ @@ -355,9 +355,9 @@ static void sched_timer_start(unsigned int ticks) ret = up_alarm_start(&ts); #else - /* [Re-]start the interval timer */ + /* [Re-]start the interval timer */ - ret = up_timer_start(&ts); + ret = up_timer_start(&ts); #endif if (ret < 0) diff --git a/sched/sched/sched_unlock.c b/sched/sched/sched_unlock.c index 81b75f0af0e..8c18aac6f14 100644 --- a/sched/sched/sched_unlock.c +++ b/sched/sched/sched_unlock.c @@ -63,7 +63,7 @@ int sched_unlock(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; /* Check for some special cases: (1) rtcb may be NULL only during * early boot-up phases, and (2) sched_unlock() should have no @@ -118,7 +118,7 @@ int sched_unlock(void) * maximum. */ - if (rtcb != (FAR struct tcb_s*)g_readytorun.head) + if (rtcb != (FAR struct tcb_s *)g_readytorun.head) { rtcb->timeslice = MSEC2TICK(CONFIG_RR_INTERVAL); } @@ -156,7 +156,7 @@ int sched_unlock(void) * change the currently active task. */ - if (rtcb == (FAR struct tcb_s*)g_readytorun.head) + if (rtcb == (FAR struct tcb_s *)g_readytorun.head) { sched_timer_reassess(); } diff --git a/sched/sched/sched_waitid.c b/sched/sched/sched_waitid.c index 9e49f9a1cd4..8c247449456 100644 --- a/sched/sched/sched_waitid.c +++ b/sched/sched/sched_waitid.c @@ -225,9 +225,9 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) /* Does this task retain child status? */ - if (retains) + if (retains) { - /* Check if this specific pid has allocated child status? */ + /* Check if this specific pid has allocated child status? */ if (group_findchild(rtcb->group, (pid_t)id) == NULL) { @@ -248,7 +248,7 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) } else if (idtype == P_PID) { - /* Get the TCB corresponding to this PID and make sure it is our child. */ + /* Get the TCB corresponding to this PID and make sure it is our child. */ ctcb = sched_gettcb((pid_t)id); #ifdef HAVE_GROUP_MEMBERS @@ -265,7 +265,7 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options) /* Loop until the child that we are waiting for dies */ - for (;;) + for (; ; ) { #ifdef CONFIG_SCHED_CHILD_STATUS /* Check if the task has already died. Signals are not queued in diff --git a/sched/sched/sched_waitpid.c b/sched/sched/sched_waitpid.c index 55d2ef3bc29..e6d4ff96ce2 100644 --- a/sched/sched/sched_waitpid.c +++ b/sched/sched/sched_waitpid.c @@ -353,11 +353,11 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* Does this task retain child status? */ - if (retains) + if (retains) { - /* Check if this specific pid has allocated child status? */ + /* Check if this specific pid has allocated child status? */ - if (group_findchild(rtcb->group, pid) == NULL) + if (group_findchild(rtcb->group, pid) == NULL) { err = ECHILD; goto errout_with_errno; @@ -376,7 +376,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) } else if (pid != (pid_t)-1) { - /* Get the TCB corresponding to this PID and make sure it is our child. */ + /* Get the TCB corresponding to this PID and make sure it is our child. */ ctcb = sched_gettcb(pid); #ifdef HAVE_GROUP_MEMBERS @@ -394,7 +394,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options) /* Loop until the child that we are waiting for dies */ - for (;;) + for (; ; ) { #ifdef CONFIG_SCHED_CHILD_STATUS /* Check if the task has already died. Signals are not queued in diff --git a/sched/sched/sched_yield.c b/sched/sched/sched_yield.c index c7051d8d73c..17d3bb0bbf5 100644 --- a/sched/sched/sched_yield.c +++ b/sched/sched/sched_yield.c @@ -90,7 +90,7 @@ int sched_yield(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; /* This equivalent to just resetting the task priority to its current value * since this will cause the task to be rescheduled behind any other tasks diff --git a/sched/semaphore/sem_holder.c b/sched/semaphore/sem_holder.c index c08f90bb5ac..7a2db8d0b41 100644 --- a/sched/semaphore/sem_holder.c +++ b/sched/semaphore/sem_holder.c @@ -290,10 +290,10 @@ static int sem_boostholderprio(FAR struct semholder_s *pholder, */ if (!sched_verifytcb(htcb)) - { + { sdbg("TCB 0x%08x is a stale handle, counts lost\n", htcb); sem_freeholder(sem, pholder); - } + } #if CONFIG_SEM_NNESTPRIO > 0 @@ -441,10 +441,10 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder, */ if (!sched_verifytcb(htcb)) - { + { sdbg("TCB 0x%08x is a stale handle, counts lost\n", htcb); sem_freeholder(sem, pholder); - } + } /* Was the priority of the holder thread boosted? If so, then drop its * priority back to the correct level. What is the correct level? @@ -573,7 +573,7 @@ static int sem_restoreholderprio(FAR struct semholder_s *pholder, static int sem_restoreholderprioA(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; if (pholder->htcb != rtcb) { return sem_restoreholderprio(pholder, sem, arg); @@ -593,7 +593,7 @@ static int sem_restoreholderprioA(FAR struct semholder_s *pholder, static int sem_restoreholderprioB(FAR struct semholder_s *pholder, FAR sem_t *sem, FAR void *arg) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; if (pholder->htcb == rtcb) { (void)sem_restoreholderprio(pholder, sem, arg); @@ -699,7 +699,7 @@ static inline void sem_restorebaseprio_irq(FAR struct tcb_s *stcb, static inline void sem_restorebaseprio_task(FAR struct tcb_s *stcb, FAR sem_t *sem) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct semholder_s *pholder; /* Perform the following actions only if a new thread was given a count. @@ -858,7 +858,7 @@ void sem_destroyholder(FAR sem_t *sem) void sem_addholder(FAR sem_t *sem) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct semholder_s *pholder; /* Find or allocate a container for this new holder */ @@ -893,7 +893,7 @@ void sem_addholder(FAR sem_t *sem) void sem_boostpriority(FAR sem_t *sem) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; /* Boost the priority of every thread holding counts on this semaphore * that are lower in priority than the new thread that is waiting for a @@ -922,7 +922,7 @@ void sem_boostpriority(FAR sem_t *sem) void sem_releaseholder(FAR sem_t *sem) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct semholder_s *pholder; /* Find the container for this holder */ diff --git a/sched/semaphore/sem_post.c b/sched/semaphore/sem_post.c index 25edceb89b7..43e78bf1547 100644 --- a/sched/semaphore/sem_post.c +++ b/sched/semaphore/sem_post.c @@ -144,7 +144,7 @@ int sem_post(FAR sem_t *sem) * that we want. */ - for (stcb = (FAR struct tcb_s*)g_waitingforsemaphore.head; + for (stcb = (FAR struct tcb_s *)g_waitingforsemaphore.head; (stcb && stcb->waitsem != sem); stcb = stcb->flink); diff --git a/sched/semaphore/sem_tickwait.c b/sched/semaphore/sem_tickwait.c index 57e36d1f0cb..a72370383e0 100644 --- a/sched/semaphore/sem_tickwait.c +++ b/sched/semaphore/sem_tickwait.c @@ -136,7 +136,7 @@ int sem_tickwait(FAR sem_t *sem, uint32_t start, uint32_t delay) /* Adjust the delay for any time since the delay was calculated */ elapsed = clock_systimer() - start; - if (/*elapsed >= (UINT32_MAX / 2) || */ elapsed >= delay) + if (/* elapsed >= (UINT32_MAX / 2) || */ elapsed >= delay) { ret = -ETIMEDOUT; goto errout_with_irqdisabled; diff --git a/sched/semaphore/sem_trywait.c b/sched/semaphore/sem_trywait.c index da4547b47ee..75c92dd7b56 100644 --- a/sched/semaphore/sem_trywait.c +++ b/sched/semaphore/sem_trywait.c @@ -96,7 +96,7 @@ int sem_trywait(FAR sem_t *sem) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; irqstate_t saved_state; int ret = ERROR; diff --git a/sched/semaphore/sem_wait.c b/sched/semaphore/sem_wait.c index 883a2c3adc0..5804fac1c59 100644 --- a/sched/semaphore/sem_wait.c +++ b/sched/semaphore/sem_wait.c @@ -96,7 +96,7 @@ int sem_wait(FAR sem_t *sem) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; irqstate_t saved_state; int ret = ERROR; diff --git a/sched/signal/sig_action.c b/sched/signal/sig_action.c index 5619dec0450..99b8aa51e86 100644 --- a/sched/signal/sig_action.c +++ b/sched/signal/sig_action.c @@ -88,7 +88,7 @@ static FAR sigactq_t *sig_allocateaction(void) /* Try to get the signal action structure from the free list */ - sigact = (FAR sigactq_t*)sq_remfirst(&g_sigfreeaction); + sigact = (FAR sigactq_t *)sq_remfirst(&g_sigfreeaction); /* Check if we got one. */ @@ -100,7 +100,7 @@ static FAR sigactq_t *sig_allocateaction(void) /* And try again */ - sigact = (FAR sigactq_t*)sq_remfirst(&g_sigfreeaction); + sigact = (FAR sigactq_t *)sq_remfirst(&g_sigfreeaction); ASSERT(sigact); } @@ -165,7 +165,7 @@ static FAR sigactq_t *sig_allocateaction(void) int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction *oact) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; FAR sigactq_t *sigact; /* Since sigactions can only be installed from the running thread of @@ -254,7 +254,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * { /* Yes.. Remove it from sigactionq */ - sq_rem((FAR sq_entry_t*)sigact, &rtcb->sigactionq); + sq_rem((FAR sq_entry_t *)sigact, &rtcb->sigactionq); /* And deallocate it */ @@ -279,10 +279,10 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * /* An error has occurred if we could not allocate the sigaction */ if (!sigact) - { + { set_errno(ENOMEM); return ERROR; - } + } /* Put the signal number in the queue entry */ @@ -290,7 +290,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * /* Add the new sigaction to sigactionq */ - sq_addlast((FAR sq_entry_t*)sigact, &rtcb->sigactionq); + sq_addlast((FAR sq_entry_t *)sigact, &rtcb->sigactionq); } /* Set the new sigaction */ @@ -313,5 +313,5 @@ void sig_releaseaction(FAR sigactq_t *sigact) { /* Just put it back on the free list */ - sq_addlast((FAR sq_entry_t*)sigact, &g_sigfreeaction); + sq_addlast((FAR sq_entry_t *)sigact, &g_sigfreeaction); } diff --git a/sched/signal/sig_allocatependingsigaction.c b/sched/signal/sig_allocatependingsigaction.c index 12e65093c55..7b408021303 100644 --- a/sched/signal/sig_allocatependingsigaction.c +++ b/sched/signal/sig_allocatependingsigaction.c @@ -88,7 +88,7 @@ FAR sigq_t *sig_allocatependingsigaction(void) { /* Try to get the pending signal action structure from the free list */ - sigq = (FAR sigq_t*)sq_remfirst(&g_sigpendingaction); + sigq = (FAR sigq_t *)sq_remfirst(&g_sigpendingaction); /* If so, then try the special list of structures reserved for * interrupt handlers @@ -96,7 +96,7 @@ FAR sigq_t *sig_allocatependingsigaction(void) if (!sigq) { - sigq = (FAR sigq_t*)sq_remfirst(&g_sigpendingirqaction); + sigq = (FAR sigq_t *)sq_remfirst(&g_sigpendingirqaction); } } @@ -108,7 +108,7 @@ FAR sigq_t *sig_allocatependingsigaction(void) /* Try to get the pending signal action structure from the free list */ saved_state = irqsave(); - sigq = (FAR sigq_t*)sq_remfirst(&g_sigpendingaction); + sigq = (FAR sigq_t *)sq_remfirst(&g_sigpendingaction); irqrestore(saved_state); /* Check if we got one. */ diff --git a/sched/signal/sig_cleanup.c b/sched/signal/sig_cleanup.c index 862defa5468..0d623e504c1 100644 --- a/sched/signal/sig_cleanup.c +++ b/sched/signal/sig_cleanup.c @@ -83,29 +83,29 @@ void sig_cleanup(FAR struct tcb_s *stcb) /* Deallocate all entries in the list of signal actions */ - while ((sigact = (FAR sigactq_t*)sq_remfirst(&stcb->sigactionq)) != NULL) + while ((sigact = (FAR sigactq_t *)sq_remfirst(&stcb->sigactionq)) != NULL) { sig_releaseaction(sigact); } /* Deallocate all entries in the list of pending signal actions */ - while ((sigq = (FAR sigq_t*)sq_remfirst(&stcb->sigpendactionq)) != NULL) + while ((sigq = (FAR sigq_t *)sq_remfirst(&stcb->sigpendactionq)) != NULL) { sig_releasependingsigaction(sigq); } /* Deallocate all entries in the list of posted signal actions */ - while ((sigq = (FAR sigq_t*)sq_remfirst(&stcb->sigpostedq)) != NULL) + while ((sigq = (FAR sigq_t *)sq_remfirst(&stcb->sigpostedq)) != NULL) { sig_releasependingsigaction(sigq); } - /* Misc. signal-related clean-up */ + /* Misc. signal-related clean-up */ - stcb->sigprocmask = ALL_SIGNAL_SET; - stcb->sigwaitmask = NULL_SIGNAL_SET; + stcb->sigprocmask = ALL_SIGNAL_SET; + stcb->sigwaitmask = NULL_SIGNAL_SET; } /**************************************************************************** @@ -125,7 +125,7 @@ void sig_release(FAR struct task_group_s *group) /* Deallocate all entries in the list of pending signals */ - while ((sigpend = (FAR sigpendq_t*)sq_remfirst(&group->sigpendingq)) != NULL) + while ((sigpend = (FAR sigpendq_t *)sq_remfirst(&group->sigpendingq)) != NULL) { sig_releasependingsignal(sigpend); } diff --git a/sched/signal/sig_deliver.c b/sched/signal/sig_deliver.c index 7f2291b4b66..212b49151bc 100644 --- a/sched/signal/sig_deliver.c +++ b/sched/signal/sig_deliver.c @@ -101,7 +101,7 @@ void sig_deliver(FAR struct tcb_s *stcb) */ saved_errno = stcb->pterrno; - for (sigq = (FAR sigq_t*)stcb->sigpendactionq.head; (sigq); sigq = next) + for (sigq = (FAR sigq_t *)stcb->sigpendactionq.head; (sigq); sigq = next) { next = sigq->flink; sdbg("Sending signal sigq=0x%x\n", sigq); @@ -112,8 +112,8 @@ void sig_deliver(FAR struct tcb_s *stcb) */ saved_state = irqsave(); - sq_rem((FAR sq_entry_t*)sigq, &(stcb->sigpendactionq)); - sq_addlast((FAR sq_entry_t*)sigq, &(stcb->sigpostedq)); + sq_rem((FAR sq_entry_t *)sigq, &(stcb->sigpendactionq)); + sq_addlast((FAR sq_entry_t *)sigq, &(stcb->sigpostedq)); irqrestore(saved_state); /* Call the signal handler (unless the signal was cancelled) @@ -173,13 +173,13 @@ void sig_deliver(FAR struct tcb_s *stcb) /* Remove the signal from the sigpostedq */ saved_state = irqsave(); - sq_rem((FAR sq_entry_t*)sigq, &(stcb->sigpostedq)); + sq_rem((FAR sq_entry_t *)sigq, &(stcb->sigpostedq)); irqrestore(saved_state); /* Then deallocate it */ sig_releasependingsigaction(sigq); - } + } stcb->pterrno = saved_errno; sched_unlock(); diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index a292424784e..9027fddddb7 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -117,15 +117,15 @@ static int sig_queueaction(FAR struct tcb_s *stcb, siginfo_t *info) { /* Populate the new signal queue element */ - sigq->action.sighandler = sigact->act.sa_u._sa_sigaction; - sigq->mask = sigact->act.sa_mask; - memcpy(&sigq->info, info, sizeof(siginfo_t)); + sigq->action.sighandler = sigact->act.sa_u._sa_sigaction; + sigq->mask = sigact->act.sa_mask; + memcpy(&sigq->info, info, sizeof(siginfo_t)); - /* Put it at the end of the pending signals list */ + /* Put it at the end of the pending signals list */ - saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)sigq, &(stcb->sigpendactionq)); - irqrestore(saved_state); + saved_state = irqsave(); + sq_addlast((FAR sq_entry_t *)sigq, &(stcb->sigpendactionq)); + irqrestore(saved_state); } } @@ -152,7 +152,7 @@ static FAR sigpendq_t *sig_allocatependingsignal(void) { /* Try to get the pending signal structure from the free list */ - sigpend = (FAR sigpendq_t*)sq_remfirst(&g_sigpendingsignal); + sigpend = (FAR sigpendq_t *)sq_remfirst(&g_sigpendingsignal); if (!sigpend) { /* If no pending signal structure is available in the free list, @@ -160,7 +160,7 @@ static FAR sigpendq_t *sig_allocatependingsignal(void) * interrupt handlers */ - sigpend = (FAR sigpendq_t*)sq_remfirst(&g_sigpendingirqsignal); + sigpend = (FAR sigpendq_t *)sq_remfirst(&g_sigpendingirqsignal); } } @@ -172,7 +172,7 @@ static FAR sigpendq_t *sig_allocatependingsignal(void) /* Try to get the pending signal structure from the free list */ saved_state = irqsave(); - sigpend = (FAR sigpendq_t*)sq_remfirst(&g_sigpendingsignal); + sigpend = (FAR sigpendq_t *)sq_remfirst(&g_sigpendingsignal); irqrestore(saved_state); /* Check if we got one. */ @@ -220,7 +220,7 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR struct task_group_s *group, /* Seach the list for a sigpendion on this signal */ - for (sigpend = (FAR sigpendq_t*)group->sigpendingq.head; + for (sigpend = (FAR sigpendq_t *)group->sigpendingq.head; (sigpend && sigpend->info.si_signo != signo); sigpend = sigpend->flink); @@ -274,7 +274,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR struct tcb_s *stcb, /* Add the structure to the pending signal list */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)sigpend, &group->sigpendingq); + sq_addlast((FAR sq_entry_t *)sigpend, &group->sigpendingq); irqrestore(saved_state); } } diff --git a/sched/signal/sig_findaction.c b/sched/signal/sig_findaction.c index 32616bfd3d8..659e8320028 100644 --- a/sched/signal/sig_findaction.c +++ b/sched/signal/sig_findaction.c @@ -89,7 +89,7 @@ FAR sigactq_t *sig_findaction(FAR struct tcb_s *stcb, int signo) /* Seach the list for a sigaction on this signal */ - for (sigact = (FAR sigactq_t*)stcb->sigactionq.head; + for (sigact = (FAR sigactq_t *)stcb->sigactionq.head; ((sigact) && (sigact->signo != signo)); sigact = sigact->flink); diff --git a/sched/signal/sig_initialize.c b/sched/signal/sig_initialize.c index bcdbc23020f..5056325ec92 100644 --- a/sched/signal/sig_initialize.c +++ b/sched/signal/sig_initialize.c @@ -147,19 +147,19 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist, static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs, uint8_t sigtype) { - sigq_t *sigqalloc; - sigq_t *sigq; - int i; + FAR sigq_t *sigqalloc; + FAR sigq_t *sigq; + int i; /* Allocate a block of pending signal actions */ - sigqalloc = (sigq_t*)kmm_malloc((sizeof(sigq_t)) * nsigs); + sigqalloc = (FAR sigq_t *)kmm_malloc((sizeof(sigq_t)) * nsigs); sigq = sigqalloc; for (i = 0; i < nsigs; i++) { sigq->type = sigtype; - sq_addlast((FAR sq_entry_t*)sigq++, siglist); + sq_addlast((FAR sq_entry_t *)sigq++, siglist); } return sigqalloc; @@ -177,20 +177,20 @@ static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs, static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist, uint16_t nsigs, uint8_t sigtype) { - sigpendq_t *sigpendalloc; - sigpendq_t *sigpend; + FAR sigpendq_t *sigpendalloc; + FAR sigpendq_t *sigpend; int i; /* Allocate a block of pending signal structures */ sigpendalloc = - (sigpendq_t*)kmm_malloc((sizeof(sigpendq_t)) * nsigs); + (FAR sigpendq_t *)kmm_malloc((sizeof(sigpendq_t)) * nsigs); sigpend = sigpendalloc; for (i = 0; i < nsigs; i++) { sigpend->type = sigtype; - sq_addlast((FAR sq_entry_t*)sigpend++, siglist); + sq_addlast((FAR sq_entry_t *)sigpend++, siglist); } return sigpendalloc; @@ -254,17 +254,17 @@ void sig_initialize(void) void sig_allocateactionblock(void) { - sigactq_t *sigact; + FAR sigactq_t *sigact; int i; /* Allocate a block of signal actions */ g_sigactionalloc = - (sigactq_t*)kmm_malloc((sizeof(sigactq_t)) * NUM_SIGNAL_ACTIONS); + (FAR sigactq_t *)kmm_malloc((sizeof(sigactq_t)) * NUM_SIGNAL_ACTIONS); sigact = g_sigactionalloc; for (i = 0; i < NUM_SIGNAL_ACTIONS; i++) { - sq_addlast((FAR sq_entry_t*)sigact++, &g_sigfreeaction); + sq_addlast((FAR sq_entry_t *)sigact++, &g_sigfreeaction); } } diff --git a/sched/signal/sig_pending.c b/sched/signal/sig_pending.c index 947813b4a9e..7615096e417 100644 --- a/sched/signal/sig_pending.c +++ b/sched/signal/sig_pending.c @@ -89,7 +89,7 @@ int sigpending(FAR sigset_t *set) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; int ret = ERROR; if (set) @@ -121,7 +121,7 @@ sigset_t sig_pendingset(FAR struct tcb_s *stcb) sigpendset = NULL_SIGNAL_SET; saved_state = irqsave(); - for (sigpend = (FAR sigpendq_t*)group->sigpendingq.head; + for (sigpend = (FAR sigpendq_t *)group->sigpendingq.head; (sigpend); sigpend = sigpend->flink) { sigaddset(&sigpendset, sigpend->info.si_signo); diff --git a/sched/signal/sig_procmask.c b/sched/signal/sig_procmask.c index d5213a7e97a..2e18c3cd9ee 100644 --- a/sched/signal/sig_procmask.c +++ b/sched/signal/sig_procmask.c @@ -113,7 +113,7 @@ int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; sigset_t oldsigprocmask; irqstate_t saved_state; int ret = OK; diff --git a/sched/signal/sig_releasependingsigaction.c b/sched/signal/sig_releasependingsigaction.c index 688af823ddb..3d47b7f2d04 100644 --- a/sched/signal/sig_releasependingsigaction.c +++ b/sched/signal/sig_releasependingsigaction.c @@ -89,9 +89,9 @@ void sig_releasependingsigaction(FAR sigq_t *sigq) * list from interrupt handlers. */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)sigq, &g_sigpendingaction); + sq_addlast((FAR sq_entry_t *)sigq, &g_sigpendingaction); irqrestore(saved_state); - } + } /* If this is a message pre-allocated for interrupts, * then put it back in the correct free list. @@ -103,7 +103,7 @@ void sig_releasependingsigaction(FAR sigq_t *sigq) * list from interrupt handlers. */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)sigq, &g_sigpendingirqaction); + sq_addlast((FAR sq_entry_t *)sigq, &g_sigpendingirqaction); irqrestore(saved_state); } diff --git a/sched/signal/sig_releasependingsignal.c b/sched/signal/sig_releasependingsignal.c index a6090850c0e..97ed25c02ab 100644 --- a/sched/signal/sig_releasependingsignal.c +++ b/sched/signal/sig_releasependingsignal.c @@ -99,7 +99,7 @@ void sig_releasependingsignal(FAR sigpendq_t *sigpend) */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)sigpend, &g_sigpendingsignal); + sq_addlast((FAR sq_entry_t *)sigpend, &g_sigpendingsignal); irqrestore(saved_state); } @@ -114,7 +114,7 @@ void sig_releasependingsignal(FAR sigpendq_t *sigpend) */ saved_state = irqsave(); - sq_addlast((FAR sq_entry_t*)sigpend, &g_sigpendingirqsignal); + sq_addlast((FAR sq_entry_t *)sigpend, &g_sigpendingirqsignal); irqrestore(saved_state); } diff --git a/sched/signal/sig_removependingsignal.c b/sched/signal/sig_removependingsignal.c index e8fdac9112d..7f2a53ee9cd 100644 --- a/sched/signal/sig_removependingsignal.c +++ b/sched/signal/sig_removependingsignal.c @@ -95,7 +95,7 @@ FAR sigpendq_t *sig_removependingsignal(FAR struct tcb_s *stcb, int signo) saved_state = irqsave(); - for (prevsig = NULL, currsig = (FAR sigpendq_t*)group->sigpendingq.head; + for (prevsig = NULL, currsig = (FAR sigpendq_t *)group->sigpendingq.head; (currsig && currsig->info.si_signo != signo); prevsig = currsig, currsig = currsig->flink); @@ -103,7 +103,7 @@ FAR sigpendq_t *sig_removependingsignal(FAR struct tcb_s *stcb, int signo) { if (prevsig) { - sq_remafter((FAR sq_entry_t*)prevsig, &group->sigpendingq); + sq_remafter((FAR sq_entry_t *)prevsig, &group->sigpendingq); } else { diff --git a/sched/signal/sig_suspend.c b/sched/signal/sig_suspend.c index 11b41fbf04c..6e9e964b702 100644 --- a/sched/signal/sig_suspend.c +++ b/sched/signal/sig_suspend.c @@ -110,7 +110,7 @@ int sigsuspend(FAR const sigset_t *set) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; sigset_t intersection; sigset_t saved_sigprocmask; FAR sigpendq_t *sigpend; diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c index 67b0032a7be..7443fd17fc7 100644 --- a/sched/signal/sig_timedwait.c +++ b/sched/signal/sig_timedwait.c @@ -93,7 +93,7 @@ static void sig_timeout(int argc, wdparm_t itcb) { /* On many small machines, pointers are encoded and cannot be simply cast - * from uint32_t to struct tcb_s*. The following union works around this + * from uint32_t to struct tcb_s *. The following union works around this * (see wdogparm_t). This odd logic could be conditioned on * CONFIG_CAN_CAST_POINTERS, but it is not too bad in any case. */ @@ -175,7 +175,7 @@ static void sig_timeout(int argc, wdparm_t itcb) int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, FAR const struct timespec *timeout) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; sigset_t intersection; FAR sigpendq_t *sigpend; irqstate_t saved_state; @@ -351,8 +351,8 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, } irqrestore(saved_state); - } + } - sched_unlock(); - return ret; + sched_unlock(); + return ret; } diff --git a/sched/signal/sig_unmaskpendingsignal.c b/sched/signal/sig_unmaskpendingsignal.c index a6df2fa19a0..5b22af67658 100644 --- a/sched/signal/sig_unmaskpendingsignal.c +++ b/sched/signal/sig_unmaskpendingsignal.c @@ -80,29 +80,29 @@ void sig_unmaskpendingsignal(void) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; - sigset_t unmaskedset; - FAR sigpendq_t *pendingsig; - int signo; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; + sigset_t unmaskedset; + FAR sigpendq_t *pendingsig; + int signo; - /* Prohibit any context switches until we are done with this. - * We may still be performing signal operations from interrupt - * handlers, however, none of the pending signals that we - * are concerned with here should be effected. - */ + /* Prohibit any context switches until we are done with this. + * We may still be performing signal operations from interrupt + * handlers, however, none of the pending signals that we + * are concerned with here should be effected. + */ - sched_lock(); + sched_lock(); - /* Get the set of pending signals that were just unmasked. The - * following operation should be safe because the sigprocmask - * can only be changed on this thread of execution. - */ + /* Get the set of pending signals that were just unmasked. The + * following operation should be safe because the sigprocmask + * can only be changed on this thread of execution. + */ - unmaskedset = ~(rtcb->sigprocmask) & sig_pendingset(rtcb); + unmaskedset = ~(rtcb->sigprocmask) & sig_pendingset(rtcb); - /* Loop while there are unmasked pending signals to be processed. */ + /* Loop while there are unmasked pending signals to be processed. */ - while (unmaskedset != NULL_SIGNAL_SET) + while (unmaskedset != NULL_SIGNAL_SET) { /* Pending signals will be processed from lowest numbered signal * to highest diff --git a/sched/task/exit.c b/sched/task/exit.c index c9683158034..f9011cb83c4 100644 --- a/sched/task/exit.c +++ b/sched/task/exit.c @@ -93,7 +93,7 @@ void exit(int status) { - struct tcb_s *tcb = (struct tcb_s*)g_readytorun.head; + struct tcb_s *tcb = (struct tcb_s *)g_readytorun.head; /* Only the lower 8-bits of status are used */ diff --git a/sched/task/task_atexit.c b/sched/task/task_atexit.c index 8e13709b9a0..07eab086441 100644 --- a/sched/task/task_atexit.c +++ b/sched/task/task_atexit.c @@ -121,7 +121,7 @@ int atexit(void (*func)(void)) return on_exit((onexitfunc_t)func, NULL); #elif defined(CONFIG_SCHED_ATEXIT_MAX) && CONFIG_SCHED_ATEXIT_MAX > 1 - FAR struct tcb_s *tcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = tcb->group; int index; int ret = ERROR; @@ -155,7 +155,7 @@ int atexit(void (*func)(void)) return ret; #else - FAR struct tcb_s *tcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = tcb->group; int ret = ERROR; diff --git a/sched/task/task_create.c b/sched/task/task_create.c index 0ab710b90b2..e853b7d521d 100644 --- a/sched/task/task_create.c +++ b/sched/task/task_create.c @@ -188,7 +188,7 @@ static int thread_create(FAR const char *name, uint8_t ttype, int priority, /* The TCB was added to the active task list by task_schedsetup() */ - dq_rem((FAR dq_entry_t*)tcb, (dq_queue_t*)&g_inactivetasks); + dq_rem((FAR dq_entry_t *)tcb, (FAR dq_queue_t *)&g_inactivetasks); goto errout_with_tcb; } diff --git a/sched/task/task_delete.c b/sched/task/task_delete.c index 7b0f06a06dc..fea823d5e8c 100644 --- a/sched/task/task_delete.c +++ b/sched/task/task_delete.c @@ -117,7 +117,7 @@ int task_delete(pid_t pid) /* Check if the task to delete is the calling task */ - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; if (pid == 0 || pid == rtcb->pid) { /* If it is, then what we really wanted to do was exit. Note that we diff --git a/sched/task/task_exit.c b/sched/task/task_exit.c index 39c52c9b752..ce9c2ad38ed 100644 --- a/sched/task/task_exit.c +++ b/sched/task/task_exit.c @@ -106,7 +106,7 @@ int task_exit(void) { - FAR struct tcb_s *dtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *dtcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct tcb_s *rtcb; int ret; @@ -119,7 +119,7 @@ int task_exit(void) */ (void)sched_removereadytorun(dtcb); - rtcb = (FAR struct tcb_s*)g_readytorun.head; + rtcb = (FAR struct tcb_s *)g_readytorun.head; /* We are now in a bad state -- the head of the ready to run task list * does not correspond to the thread that is running. Disabling pre- diff --git a/sched/task/task_exithook.c b/sched/task/task_exithook.c index f6b5ffa5503..bc72151be19 100644 --- a/sched/task/task_exithook.c +++ b/sched/task/task_exithook.c @@ -529,8 +529,8 @@ static inline void task_exitwakeup(FAR struct tcb_s *tcb, int status) { /* Yes.. Wakeup any tasks waiting for this task to exit */ - group->tg_statloc = NULL; - while (group->tg_exitsem.semcount < 0) + group->tg_statloc = NULL; + while (group->tg_exitsem.semcount < 0) { /* Wake up the thread */ diff --git a/sched/task/task_onexit.c b/sched/task/task_onexit.c index 424d4428c19..a1172abd068 100644 --- a/sched/task/task_onexit.c +++ b/sched/task/task_onexit.c @@ -116,7 +116,7 @@ int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg) { #if defined(CONFIG_SCHED_ONEXIT_MAX) && CONFIG_SCHED_ONEXIT_MAX > 1 - FAR struct tcb_s *tcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = tcb->group; int index; int ret = ENOSPC; @@ -151,7 +151,7 @@ int on_exit(CODE void (*func)(int, FAR void *), FAR void *arg) return ret; #else - FAR struct tcb_s *tcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head; FAR struct task_group_s *group = tcb->group; int ret = ENOSPC; diff --git a/sched/task/task_posixspawn.c b/sched/task/task_posixspawn.c index 65ee785ab34..17172086fc1 100644 --- a/sched/task/task_posixspawn.c +++ b/sched/task/task_posixspawn.c @@ -438,22 +438,22 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path, goto errout_with_lock; } - /* Wait for the proxy to complete its job */ + /* Wait for the proxy to complete its job */ #ifdef CONFIG_SCHED_WAITPID - ret = waitpid(proxy, &status, 0); - if (ret < 0) - { - sdbg("ERROR: waitpid() failed: %d\n", errno); - goto errout_with_lock; - } + ret = waitpid(proxy, &status, 0); + if (ret < 0) + { + sdbg("ERROR: waitpid() failed: %d\n", errno); + goto errout_with_lock; + } #else - spawn_semtake(&g_spawn_execsem); + spawn_semtake(&g_spawn_execsem); #endif - /* Get the result and relinquish our access to the parameter structure */ + /* Get the result and relinquish our access to the parameter structure */ - ret = g_spawn_parms.result; + ret = g_spawn_parms.result; errout_with_lock: #ifdef CONFIG_SCHED_WAITPID diff --git a/sched/task/task_restart.c b/sched/task/task_restart.c index eaf25ab73d5..e6229adf4fc 100644 --- a/sched/task/task_restart.c +++ b/sched/task/task_restart.c @@ -160,8 +160,8 @@ int task_restart(pid_t pid) */ state = irqsave(); - dq_rem((FAR dq_entry_t*)tcb, - (dq_queue_t*)g_tasklisttable[tcb->cmn.task_state].list); + dq_rem((FAR dq_entry_t *)tcb, + (FAR dq_queue_t *)g_tasklisttable[tcb->cmn.task_state].list); tcb->cmn.task_state = TSTATE_TASK_INVALID; irqrestore(state); @@ -190,7 +190,7 @@ int task_restart(pid_t pid) /* Add the task to the inactive task list */ - dq_addfirst((FAR dq_entry_t*)tcb, (dq_queue_t*)&g_inactivetasks); + dq_addfirst((FAR dq_entry_t *)tcb, (FAR dq_queue_t *)&g_inactivetasks); tcb->cmn.task_state = TSTATE_TASK_INACTIVE; /* Activate the task */ diff --git a/sched/task/task_setup.c b/sched/task/task_setup.c index 5b36fe5d613..feb45b83fdf 100644 --- a/sched/task/task_setup.c +++ b/sched/task/task_setup.c @@ -82,7 +82,7 @@ static const char g_noname[] = ""; * Private Function Prototypes ****************************************************************************/ -static int task_assignpid(FAR struct tcb_s* tcb); +static int task_assignpid(FAR struct tcb_s * tcb); /**************************************************************************** * Private Functions @@ -183,7 +183,7 @@ static int task_assignpid(FAR struct tcb_s *tcb) #ifdef CONFIG_SCHED_HAVE_PARENT static inline void task_saveparent(FAR struct tcb_s *tcb, uint8_t ttype) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; #if defined(HAVE_GROUP_MEMBERS) || defined(CONFIG_SCHED_CHILD_STATUS) DEBUGASSERT(tcb && tcb->group && rtcb->group); @@ -288,7 +288,7 @@ static inline void task_saveparent(FAR struct tcb_s *tcb, uint8_t ttype) #ifdef CONFIG_PIC static inline void task_dupdspace(FAR struct tcb_s *tcb) { - FAR struct tcb_s *rtcb = (FAR struct tcb_s*)g_readytorun.head; + FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head; if (rtcb->dspace != NULL) { /* Copy the D-Space structure reference and increment the reference @@ -390,7 +390,7 @@ static int thread_schedsetup(FAR struct tcb_s *tcb, int priority, /* Add the task to the inactive task list */ sched_lock(); - dq_addfirst((FAR dq_entry_t*)tcb, (dq_queue_t*)&g_inactivetasks); + dq_addfirst((FAR dq_entry_t *)tcb, (FAR dq_queue_t *)&g_inactivetasks); tcb->task_state = TSTATE_TASK_INACTIVE; sched_unlock(); } @@ -499,7 +499,7 @@ static inline int task_stackargsetup(FAR struct task_tcb_s *tcb, strtablen += (strlen(argv[argc]) + 1); if (strtablen >= tcb->cmn.adj_stack_size) { - return -ENAMETOOLONG; + return -ENAMETOOLONG; } /* Increment the number of args. Here is a sanity check to @@ -520,7 +520,7 @@ static inline int task_stackargsetup(FAR struct task_tcb_s *tcb, * task name plus a NULL argv[] entry to terminate the list. */ - argvlen = (argc + 2)*sizeof(FAR char*); + argvlen = (argc + 2) * sizeof(FAR char *); stackargv = (FAR char **)up_stack_frame(&tcb->cmn, argvlen + strtablen); DEBUGASSERT(stackargv != NULL); diff --git a/sched/task/task_spawn.c b/sched/task/task_spawn.c index 02083a19ac2..ef686e03ade 100644 --- a/sched/task/task_spawn.c +++ b/sched/task/task_spawn.c @@ -421,7 +421,7 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, proxy = task_create("task_spawn_proxy", param.sched_priority, CONFIG_POSIX_SPAWN_PROXY_STACKSIZE, (main_t)task_spawn_proxy, - (FAR char * const*)NULL); + (FAR char * const *)NULL); if (proxy < 0) { ret = get_errno(); @@ -430,22 +430,22 @@ int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry, goto errout_with_lock; } - /* Wait for the proxy to complete its job */ + /* Wait for the proxy to complete its job */ #ifdef CONFIG_SCHED_WAITPID - ret = waitpid(proxy, &status, 0); - if (ret < 0) - { - sdbg("ERROR: waitpid() failed: %d\n", errno); - goto errout_with_lock; - } + ret = waitpid(proxy, &status, 0); + if (ret < 0) + { + sdbg("ERROR: waitpid() failed: %d\n", errno); + goto errout_with_lock; + } #else - spawn_semtake(&g_spawn_execsem); + spawn_semtake(&g_spawn_execsem); #endif - /* Get the result and relinquish our access to the parameter structure */ + /* Get the result and relinquish our access to the parameter structure */ - ret = g_spawn_parms.result; + ret = g_spawn_parms.result; errout_with_lock: #ifdef CONFIG_SCHED_WAITPID diff --git a/sched/task/task_start.c b/sched/task/task_start.c index 48ab75a3ad1..6beeccff97a 100644 --- a/sched/task/task_start.c +++ b/sched/task/task_start.c @@ -100,7 +100,7 @@ void task_start(void) { - FAR struct task_tcb_s *tcb = (FAR struct task_tcb_s*)g_readytorun.head; + FAR struct task_tcb_s *tcb = (FAR struct task_tcb_s *)g_readytorun.head; int exitcode; int argc; diff --git a/sched/task/task_terminate.c b/sched/task/task_terminate.c index b3f5678b906..684c09da8dc 100644 --- a/sched/task/task_terminate.c +++ b/sched/task/task_terminate.c @@ -168,7 +168,8 @@ int task_terminate(pid_t pid, bool nonblocking) /* Remove the task from the OS's tasks lists. */ saved_state = irqsave(); - dq_rem((FAR dq_entry_t*)dtcb, (dq_queue_t*)g_tasklisttable[dtcb->task_state].list); + dq_rem((FAR dq_entry_t *)dtcb, + (FAR dq_queue_t *)g_tasklisttable[dtcb->task_state].list); dtcb->task_state = TSTATE_TASK_INVALID; irqrestore(saved_state); diff --git a/sched/task/task_vfork.c b/sched/task/task_vfork.c index 20e74179b1f..65cdf481cfd 100644 --- a/sched/task/task_vfork.c +++ b/sched/task/task_vfork.c @@ -458,7 +458,7 @@ void task_vforkabort(FAR struct task_tcb_s *child, int errcode) { /* The TCB was added to the active task list by task_schedsetup() */ - dq_rem((FAR dq_entry_t*)child, (dq_queue_t*)&g_inactivetasks); + dq_rem((FAR dq_entry_t *)child, (FAR dq_queue_t *)&g_inactivetasks); /* Release the TCB */ diff --git a/sched/timer/timer_create.c b/sched/timer/timer_create.c index fc8f9acd4ab..a750a879b42 100644 --- a/sched/timer/timer_create.c +++ b/sched/timer/timer_create.c @@ -78,15 +78,15 @@ static struct posix_timer_s *timer_allocate(void) { - struct posix_timer_s *ret; - irqstate_t flags; - uint8_t pt_flags; + FAR struct posix_timer_s *ret; + irqstate_t flags; + uint8_t pt_flags; /* Try to get a preallocated timer from the free list */ #if CONFIG_PREALLOC_TIMERS > 0 flags = irqsave(); - ret = (struct posix_timer_s*)sq_remfirst((sq_queue_t*)&g_freetimers); + ret = (FAR struct posix_timer_s *)sq_remfirst((FAR sq_queue_t *)&g_freetimers); irqrestore(flags); /* Did we get one? */ @@ -100,7 +100,7 @@ static struct posix_timer_s *timer_allocate(void) { /* Allocate a new timer from the heap */ - ret = (struct posix_timer_s*)kmm_malloc(sizeof(struct posix_timer_s)); + ret = (FAR struct posix_timer_s *)kmm_malloc(sizeof(struct posix_timer_s)); pt_flags = 0; } @@ -116,7 +116,7 @@ static struct posix_timer_s *timer_allocate(void) /* And add it to the end of the list of allocated timers */ flags = irqsave(); - sq_addlast((sq_entry_t*)ret, (sq_queue_t*)&g_alloctimers); + sq_addlast((FAR sq_entry_t *)ret, (FAR sq_queue_t *)&g_alloctimers); irqrestore(flags); } diff --git a/sched/timer/timer_initialize.c b/sched/timer/timer_initialize.c index e28445d5e72..ab0c16d70ca 100644 --- a/sched/timer/timer_initialize.c +++ b/sched/timer/timer_initialize.c @@ -113,18 +113,19 @@ void weak_function timer_initialize(void) /* Place all of the pre-allocated timers into the free timer list */ - sq_init((sq_queue_t*)&g_freetimers); + sq_init((FAR sq_queue_t *)&g_freetimers); for (i = 0; i < CONFIG_PREALLOC_TIMERS; i++) { g_prealloctimers[i].pt_flags = PT_FLAGS_PREALLOCATED; - sq_addlast((FAR sq_entry_t*)&g_prealloctimers[i], (FAR sq_queue_t*)&g_freetimers); + sq_addlast((FAR sq_entry_t *)&g_prealloctimers[i], + (FAR sq_queue_t *)&g_freetimers); } #endif /* Initialize the list of allocated timers */ - sq_init((sq_queue_t*)&g_alloctimers); + sq_init((FAR sq_queue_t *)&g_alloctimers); } /******************************************************************************** @@ -155,7 +156,7 @@ void weak_function timer_deleteall(pid_t pid) irqstate_t flags; flags = irqsave(); - for (timer = (FAR struct posix_timer_s*)g_alloctimers.head; timer; timer = next) + for (timer = (FAR struct posix_timer_s *)g_alloctimers.head; timer; timer = next) { next = timer->flink; if (timer->pt_owner == pid) diff --git a/sched/timer/timer_release.c b/sched/timer/timer_release.c index 2eb2a004bdc..85e5b857c38 100644 --- a/sched/timer/timer_release.c +++ b/sched/timer/timer_release.c @@ -81,14 +81,14 @@ static inline void timer_free(struct posix_timer_s *timer) /* Remove the timer from the allocated list */ flags = irqsave(); - sq_rem((FAR sq_entry_t*)timer, (sq_queue_t*)&g_alloctimers); + sq_rem((FAR sq_entry_t *)timer, (FAR sq_queue_t *)&g_alloctimers); /* Return it to the free list if it is one of the preallocated timers */ #if CONFIG_PREALLOC_TIMERS > 0 if ((timer->pt_flags & PT_FLAGS_PREALLOCATED) != 0) { - sq_addlast((FAR sq_entry_t*)timer, (FAR sq_queue_t*)&g_freetimers); + sq_addlast((FAR sq_entry_t *)timer, (FAR sq_queue_t *)&g_freetimers); irqrestore(flags); } else diff --git a/sched/timer/timer_settime.c b/sched/timer/timer_settime.c index 1145ff77835..01be3a28ae3 100644 --- a/sched/timer/timer_settime.c +++ b/sched/timer/timer_settime.c @@ -170,7 +170,7 @@ static void timer_timeout(int argc, wdparm_t itimer) { #ifndef CONFIG_CAN_PASS_STRUCTS /* On many small machines, pointers are encoded and cannot be simply cast from - * wdparm_t to struct tcb_s*. The following union works around this (see wdogparm_t). + * wdparm_t to struct tcb_s *. The following union works around this (see wdogparm_t). */ union diff --git a/sched/wdog/wd_cancel.c b/sched/wdog/wd_cancel.c index 3a20cd611de..225e62a2232 100644 --- a/sched/wdog/wd_cancel.c +++ b/sched/wdog/wd_cancel.c @@ -143,7 +143,7 @@ int wd_cancel(WDOG_ID wdog) { /* Remove the watchdog from mid- or end-of-queue */ - (void)sq_remafter((FAR sq_entry_t*)prev, &g_wdactivelist); + (void)sq_remafter((FAR sq_entry_t *)prev, &g_wdactivelist); } else { diff --git a/sched/wdog/wd_delete.c b/sched/wdog/wd_delete.c index 789f0b007f4..14156418ad4 100644 --- a/sched/wdog/wd_delete.c +++ b/sched/wdog/wd_delete.c @@ -142,7 +142,7 @@ int wd_delete(WDOG_ID wdog) * timers, all with interrupts disabled. */ - sq_addlast((FAR sq_entry_t*)wdog, &g_wdfreelist); + sq_addlast((FAR sq_entry_t *)wdog, &g_wdfreelist); g_wdnfree++; DEBUGASSERT(g_wdnfree <= CONFIG_PREALLOC_WDOGS); irqrestore(state); diff --git a/sched/wdog/wd_initialize.c b/sched/wdog/wd_initialize.c index b745c19b66e..84894903cb6 100644 --- a/sched/wdog/wd_initialize.c +++ b/sched/wdog/wd_initialize.c @@ -80,7 +80,7 @@ uint16_t g_wdnfree; ****************************************************************************/ /* g_wdpool is a list of pre-allocated watchdogs. The number of watchdogs -* in the pool is a configuration item. + * in the pool is a configuration item. */ static struct wdog_s g_wdpool[CONFIG_PREALLOC_WDOGS]; @@ -128,7 +128,7 @@ void wd_initialize(void) for (i = 0; i < CONFIG_PREALLOC_WDOGS; i++) { - sq_addlast((FAR sq_entry_t*)wdog++, &g_wdfreelist); + sq_addlast((FAR sq_entry_t *)wdog++, &g_wdfreelist); } /* All watchdogs are free */ diff --git a/sched/wdog/wd_start.c b/sched/wdog/wd_start.c index 90ce73c151f..de3b05603eb 100644 --- a/sched/wdog/wd_start.c +++ b/sched/wdog/wd_start.c @@ -180,7 +180,7 @@ static inline void wd_expiration(void) case 4: (*((wdentry4_t)(wdog->func)))(4, wdog->parm[0], wdog->parm[1], - wdog->parm[2] ,wdog->parm[3]); + wdog->parm[2], wdog->parm[3]); break; #endif } @@ -301,7 +301,7 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) { /* Add the watchdog to the head == tail of the queue. */ - sq_addlast((FAR sq_entry_t*)wdog, &g_wdactivelist); + sq_addlast((FAR sq_entry_t *)wdog, &g_wdactivelist); } /* There are other active watchdogs in the timer queue */ @@ -322,11 +322,11 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) /* Advance past shorter delays */ while (now <= delay && curr->next) - { - prev = curr; - curr = curr->next; - now += curr->lag; - } + { + prev = curr; + curr = curr->next; + now += curr->lag; + } /* Check if the new wdog must be inserted before the curr. */ @@ -368,13 +368,13 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) delay -= now; if (!curr->next) { - sq_addlast((FAR sq_entry_t*)wdog, &g_wdactivelist); + sq_addlast((FAR sq_entry_t *)wdog, &g_wdactivelist); } else { next = curr->next; next->lag -= delay; - sq_addafter((FAR sq_entry_t*)curr, (FAR sq_entry_t*)wdog, + sq_addafter((FAR sq_entry_t *)curr, (FAR sq_entry_t *)wdog, &g_wdactivelist); } } diff --git a/sched/wqueue/kwork_hpthread.c b/sched/wqueue/kwork_hpthread.c index 81ac4c24ffe..5a6b3879997 100644 --- a/sched/wqueue/kwork_hpthread.c +++ b/sched/wqueue/kwork_hpthread.c @@ -106,7 +106,7 @@ static int work_hpthread(int argc, char *argv[]) { /* Loop forever */ - for (;;) + for (; ; ) { #ifndef CONFIG_SCHED_LPWORK /* First, perform garbage collection. This cleans-up memory diff --git a/sched/wqueue/kwork_lpthread.c b/sched/wqueue/kwork_lpthread.c index c355596c092..eacbb6a2650 100644 --- a/sched/wqueue/kwork_lpthread.c +++ b/sched/wqueue/kwork_lpthread.c @@ -127,7 +127,7 @@ static int work_lpthread(int argc, char *argv[]) /* Loop forever */ - for (;;) + for (; ; ) { #if CONFIG_SCHED_LPNTHREADS > 0 /* Thread 0 is special. Only thread 0 performs period garbage collection */ @@ -147,14 +147,14 @@ static int work_lpthread(int argc, char *argv[]) #endif { /* Perform garbage collection. This cleans-up memory de-allocations - * that were queued because they could not be freed in that execution - * context (for example, if the memory was freed from an interrupt handler). - * NOTE: If the work thread is disabled, this clean-up is performed by - * the IDLE thread (at a very, very low priority). - * - * In the event of multiple low priority threads, on index == 0 will do - * the garbage collection. - */ + * that were queued because they could not be freed in that execution + * context (for example, if the memory was freed from an interrupt handler). + * NOTE: If the work thread is disabled, this clean-up is performed by + * the IDLE thread (at a very, very low priority). + * + * In the event of multiple low priority threads, on index == 0 will do + * the garbage collection. + */ sched_garbagecollection(); diff --git a/sched/wqueue/kwork_process.c b/sched/wqueue/kwork_process.c index 6333a6c2197..ff854fe83ad 100644 --- a/sched/wqueue/kwork_process.c +++ b/sched/wqueue/kwork_process.c @@ -239,20 +239,20 @@ void work_process(FAR struct kwork_wqueue_s *wqueue, uint32_t period, int wndx) * period will be non-zero and equal to wqueue->delay. */ - if (period == 0) - { - sigset_t set; + if (period == 0) + { + sigset_t set; - /* Wait indefinitely until signalled with SIGWORK */ + /* Wait indefinitely until signalled with SIGWORK */ - sigemptyset(&set); - sigaddset(&set, SIGWORK); + sigemptyset(&set); + sigaddset(&set, SIGWORK); - wqueue->worker[wndx].busy = false; - DEBUGVERIFY(sigwaitinfo(&set, NULL)); + wqueue->worker[wndx].busy = false; + DEBUGVERIFY(sigwaitinfo(&set, NULL)); wqueue->worker[wndx].busy = true; - } - else + } + else #endif { /* Get the delay (in clock ticks) since we started the sampling */