diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-07 11:07:31 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-07 11:07:31 +0000 |
commit | 272b51ba236d6636bda3ee961cba35eb489d30af (patch) | |
tree | 2120de0e1054da930c0c54b7a071f5fd73ac3014 /os/rt/src/chschd.c | |
parent | 57585301af1df353c3dd3a6e389d074bd4de4fcc (diff) | |
download | ChibiOS-272b51ba236d6636bda3ee961cba35eb489d30af.tar.gz ChibiOS-272b51ba236d6636bda3ee961cba35eb489d30af.tar.bz2 ChibiOS-272b51ba236d6636bda3ee961cba35eb489d30af.zip |
MISRAs done for RT.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7727 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src/chschd.c')
-rw-r--r-- | os/rt/src/chschd.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c index 6775b1a12..dacc1b7c1 100644 --- a/os/rt/src/chschd.c +++ b/os/rt/src/chschd.c @@ -87,17 +87,16 @@ void _scheduler_init(void) { */
void queue_prio_insert(thread_t *tp, threads_queue_t *tqp) {
- /* cp iterates over the queue.*/
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
thread_t *cp = (thread_t *)tqp;
do {
- /* Iterate to next thread in queue.*/
cp = cp->p_next;
- /* Not end of queue? and cp has equal or higher priority than tp?.*/
} while ((cp != (thread_t *)tqp) && (cp->p_prio >= tp->p_prio));
- /* Insertion on p_prev.*/
+ /*lint -restore*/
tp->p_next = cp;
tp->p_prev = cp->p_prev;
- tp->p_prev->p_next = cp->p_prev = tp;
+ tp->p_prev->p_next = tp;
+ cp->p_prev = tp;
}
/**
@@ -110,9 +109,12 @@ void queue_prio_insert(thread_t *tp, threads_queue_t *tqp) { */
void queue_insert(thread_t *tp, threads_queue_t *tqp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
tp->p_next = (thread_t *)tqp;
+ /*lint -restore*/
tp->p_prev = tqp->p_prev;
- tp->p_prev->p_next = tqp->p_prev = tp;
+ tp->p_prev->p_next = tp;
+ tqp->p_prev = tp;
}
/**
@@ -128,7 +130,10 @@ void queue_insert(thread_t *tp, threads_queue_t *tqp) { 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;
+ tqp->p_next = tp->p_next;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ tqp->p_next->p_prev = (thread_t *)tqp;
+ /*lint -restore*/
return tp;
}
@@ -146,7 +151,10 @@ thread_t *queue_fifo_remove(threads_queue_t *tqp) { 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;
+ tqp->p_prev = tp->p_prev;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ tqp->p_prev->p_next = (thread_t *)tqp;
+ /*lint -restore*/
return tp;
}
|