Remove redundant sc_active checks

sc_sporadic() already calls sc_active.

Signed-off-by: Indan Zupancic <Indan.Zupancic@mep-info.com>
This commit is contained in:
Indan Zupancic
2022-05-20 14:20:15 +02:00
committed by Kent McLeod
parent b316072daa
commit 3978092885
2 changed files with 5 additions and 5 deletions

View File

@@ -91,7 +91,7 @@ void restart(tcb_t *target)
cancelIPC(target); cancelIPC(target);
#ifdef CONFIG_KERNEL_MCS #ifdef CONFIG_KERNEL_MCS
setThreadState(target, ThreadState_Restart); setThreadState(target, ThreadState_Restart);
if (sc_sporadic(target->tcbSchedContext) && sc_active(target->tcbSchedContext) if (sc_sporadic(target->tcbSchedContext)
&& target->tcbSchedContext != NODE_STATE(ksCurSC)) { && target->tcbSchedContext != NODE_STATE(ksCurSC)) {
refill_unblock_check(target->tcbSchedContext); refill_unblock_check(target->tcbSchedContext);
} }
@@ -142,7 +142,7 @@ void doReplyTransfer(tcb_t *sender, tcb_t *receiver, cte_t *slot, bool_t grant)
assert(thread_state_get_replyObject(receiver->tcbState) == REPLY_REF(0)); assert(thread_state_get_replyObject(receiver->tcbState) == REPLY_REF(0));
assert(reply->replyTCB == NULL); assert(reply->replyTCB == NULL);
if (sc_sporadic(receiver->tcbSchedContext) && sc_active(receiver->tcbSchedContext) if (sc_sporadic(receiver->tcbSchedContext)
&& receiver->tcbSchedContext != NODE_STATE_ON_CORE(ksCurSC, receiver->tcbSchedContext->scCore)) { && receiver->tcbSchedContext != NODE_STATE_ON_CORE(ksCurSC, receiver->tcbSchedContext->scCore)) {
refill_unblock_check(receiver->tcbSchedContext); refill_unblock_check(receiver->tcbSchedContext);
} }

View File

@@ -81,7 +81,7 @@ void sendSignal(notification_t *ntfnPtr, word_t badge)
possibleSwitchTo(tcb); possibleSwitchTo(tcb);
}) })
#ifdef CONFIG_KERNEL_MCS #ifdef CONFIG_KERNEL_MCS
if (sc_sporadic(tcb->tcbSchedContext) && sc_active(tcb->tcbSchedContext)) { if (sc_sporadic(tcb->tcbSchedContext)) {
/* We know that the tcb can't have the current SC /* We know that the tcb can't have the current SC
* as its own SC as this point as it should still be * as its own SC as this point as it should still be
* associated with the current thread, or no thread. * associated with the current thread, or no thread.
@@ -166,7 +166,7 @@ void sendSignal(notification_t *ntfnPtr, word_t badge)
}) })
#ifdef CONFIG_KERNEL_MCS #ifdef CONFIG_KERNEL_MCS
if (sc_sporadic(dest->tcbSchedContext) && sc_active(dest->tcbSchedContext)) { if (sc_sporadic(dest->tcbSchedContext)) {
/* We know that the receiver can't have the current SC /* We know that the receiver can't have the current SC
* as its own SC as this point as it should still be * as its own SC as this point as it should still be
* associated with the current thread. * associated with the current thread.
@@ -310,7 +310,7 @@ void completeSignal(notification_t *ntfnPtr, tcb_t *tcb)
notification_ptr_set_state(ntfnPtr, NtfnState_Idle); notification_ptr_set_state(ntfnPtr, NtfnState_Idle);
#ifdef CONFIG_KERNEL_MCS #ifdef CONFIG_KERNEL_MCS
maybeDonateSchedContext(tcb, ntfnPtr); maybeDonateSchedContext(tcb, ntfnPtr);
if (sc_sporadic(tcb->tcbSchedContext) && sc_active(tcb->tcbSchedContext)) { if (sc_sporadic(tcb->tcbSchedContext)) {
sched_context_t *sc = SC_PTR(notification_ptr_get_ntfnSchedContext(ntfnPtr)); sched_context_t *sc = SC_PTR(notification_ptr_get_ntfnSchedContext(ntfnPtr));
if (tcb->tcbSchedContext == sc && tcb->tcbSchedContext != NODE_STATE(ksCurSC)) { if (tcb->tcbSchedContext == sc && tcb->tcbSchedContext != NODE_STATE(ksCurSC)) {
/* We know that the tcb can't have the current SC /* We know that the tcb can't have the current SC