aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chschd.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-03 11:01:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-03 11:01:09 +0000
commitfbd65c1f6ae3c802467ab99f4b2fe9c7c084972e (patch)
treecafc124edd19ce4f3b676a9de703f7a0aefed409 /os/rt/src/chschd.c
parent3d1a86e9fb0b9495a726dab534e97c063b5f368b (diff)
downloadChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.tar.gz
ChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.tar.bz2
ChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.zip
MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7711 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src/chschd.c')
-rw-r--r--os/rt/src/chschd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c
index afc843983..2640f25e9 100644
--- a/os/rt/src/chschd.c
+++ b/os/rt/src/chschd.c
@@ -126,6 +126,7 @@ thread_t *queue_fifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->p_next;
(tqp->p_next = tp->p_next)->p_prev = (thread_t *)tqp;
+
return tp;
}
@@ -143,6 +144,7 @@ thread_t *queue_lifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->p_prev;
(tqp->p_prev = tp->p_prev)->p_next = (thread_t *)tqp;
+
return tp;
}
@@ -160,6 +162,7 @@ thread_t *queue_dequeue(thread_t *tp) {
tp->p_prev->p_next = tp->p_next;
tp->p_next->p_prev = tp->p_prev;
+
return tp;
}
@@ -190,6 +193,7 @@ thread_t *list_remove(threads_list_t *tlp) {
thread_t *tp = tlp->p_next;
tlp->p_next = tp->p_next;
+
return tp;
}
#endif /* CH_CFG_OPTIMIZE_SPEED */
@@ -228,6 +232,7 @@ thread_t *chSchReadyI(thread_t *tp) {
tp->p_next = cp;
tp->p_prev = cp->p_prev;
tp->p_prev->p_next = cp->p_prev = tp;
+
return tp;
}
@@ -327,8 +332,10 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
if (chVTIsArmedI(&vt))
chVTDoResetI(&vt);
}
- else
+ else {
chSchGoSleepS(newstate);
+ }
+
return currp->p_u.rdymsg;
}
@@ -388,8 +395,9 @@ void chSchRescheduleS(void) {
chDbgCheckClassS();
- if (chSchIsRescRequiredI())
+ if (chSchIsRescRequiredI()) {
chSchDoRescheduleAhead();
+ }
}
/**
@@ -408,6 +416,7 @@ void chSchRescheduleS(void) {
bool chSchIsPreemptionRequired(void) {
tprio_t p1 = firstprio(&ch.rlist.r_queue);
tprio_t p2 = currp->p_prio;
+
#if CH_CFG_TIME_QUANTUM > 0
/* If the running thread has not reached its time quantum, reschedule only
if the first thread on the ready queue has a higher priority.