Skip to content

Commit 8acd8d4

Browse files
committed
Refactor edf_sched to align with embedded node
The condition check is removed because the node is embedded in the tcb, no need to confirm whether tcb is existing anymore. The access of tcb_t is replaced by the marco to align with the embedded node design.
1 parent 50fe97c commit 8acd8d4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

app/rtsched.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,7 @@ static int32_t edf_sched(void)
404404
/* Scan all tasks to find the one with earliest deadline */
405405
list_node_t *node = list_next(kcb->tasks->head);
406406
while (node && node != kcb->tasks->tail) {
407-
if (!node->data) {
408-
node = list_next(node);
409-
continue;
410-
}
411-
412-
tcb_t *task = (tcb_t *) node->data;
407+
tcb_t *task = tcb_from_global_node(node);
413408

414409
/* Consider both READY and RUNNING RT tasks for preemptive scheduling */
415410
if ((task->state == TASK_READY || task->state == TASK_RUNNING) &&

0 commit comments

Comments
 (0)