Skip to content

Commit 5d54006

Browse files
committed
Tweak bitwise operation
1 parent 0666656 commit 5d54006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/task.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ static list_node_t *find_next_ready_task(void)
243243
/* If the counter reaches zero, this task is selected to run. */
244244
if (counter == 0) {
245245
/* Reload counter from its base priority for the next cycle. */
246-
counter = (task->prio >> 8) & 0xFF;
247-
task->prio = (task->prio & 0xFF00) | counter;
246+
uint8_t base = task->prio >> 8;
247+
task->prio = (task->prio & 0xFF00) | base;
248248
kcb->last_ready_hint = node; /* Update hint for next time */
249249
return node;
250250
}

0 commit comments

Comments
 (0)