summaryrefslogtreecommitdiff
path: root/nuttx/sched/sched_mergepending.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-04-25 15:19:59 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-04-25 15:19:59 -0600
commit1ffc15c3233c8d61953fc2ebc80b5d3c46fc429f (patch)
tree95050f5e635b87d26f4dd98612b05edf632b2a96 /nuttx/sched/sched_mergepending.c
parent5f6e91b0ed1b373d0b4f963b0e0f8f7fe05ec766 (diff)
downloadpx4-nuttx-1ffc15c3233c8d61953fc2ebc80b5d3c46fc429f.tar.gz
px4-nuttx-1ffc15c3233c8d61953fc2ebc80b5d3c46fc429f.tar.bz2
px4-nuttx-1ffc15c3233c8d61953fc2ebc80b5d3c46fc429f.zip
Remove up_assert_code
Diffstat (limited to 'nuttx/sched/sched_mergepending.c')
-rw-r--r--nuttx/sched/sched_mergepending.c59
1 files changed, 27 insertions, 32 deletions
diff --git a/nuttx/sched/sched_mergepending.c b/nuttx/sched/sched_mergepending.c
index 1364d2b1c..c400fee4d 100644
--- a/nuttx/sched/sched_mergepending.c
+++ b/nuttx/sched/sched_mergepending.c
@@ -125,42 +125,37 @@ bool sched_mergepending(void)
* the g_readytorun list!
*/
- if (!rtrtcb)
+ ASSERT(rtrtcb);
+
+ /* The pndtcb goes just before rtrtcb */
+
+ rtrprev = rtrtcb->blink;
+ if (!rtrprev)
{
- PANIC(OSERR_NOIDLETASK);
+ /* Special case: Inserting pndtcb at the head of the list */
+ /* Inform the instrumentation layer that we are switching tasks */
+
+ sched_note_switch(rtrtcb, pndtcb);
+
+ /* Then insert at the head of the list */
+
+ pndtcb->flink = rtrtcb;
+ pndtcb->blink = NULL;
+ rtrtcb->blink = pndtcb;
+ g_readytorun.head = (FAR dq_entry_t*)pndtcb;
+ rtrtcb->task_state = TSTATE_TASK_READYTORUN;
+ pndtcb->task_state = TSTATE_TASK_RUNNING;
+ ret = true;
}
else
{
- /* The pndtcb goes just before rtrtcb */
-
- rtrprev = rtrtcb->blink;
- if (!rtrprev)
- {
- /* Special case: Inserting pndtcb at the head of the list */
- /* Inform the instrumentation layer that we are switching tasks */
-
- sched_note_switch(rtrtcb, pndtcb);
-
- /* Then insert at the head of the list */
-
- pndtcb->flink = rtrtcb;
- pndtcb->blink = NULL;
- rtrtcb->blink = pndtcb;
- g_readytorun.head = (FAR dq_entry_t*)pndtcb;
- rtrtcb->task_state = TSTATE_TASK_READYTORUN;
- pndtcb->task_state = TSTATE_TASK_RUNNING;
- ret = true;
- }
- else
- {
- /* Insert in the middle of the list */
-
- pndtcb->flink = rtrtcb;
- pndtcb->blink = rtrprev;
- rtrprev->flink = pndtcb;
- rtrtcb->blink = pndtcb;
- pndtcb->task_state = TSTATE_TASK_READYTORUN;
- }
+ /* Insert in the middle of the list */
+
+ pndtcb->flink = rtrtcb;
+ pndtcb->blink = rtrprev;
+ rtrprev->flink = pndtcb;
+ rtrtcb->blink = pndtcb;
+ pndtcb->task_state = TSTATE_TASK_READYTORUN;
}
/* Set up for the next time through */