diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-07 09:25:13 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-07 09:25:13 +0000 |
commit | 57585301af1df353c3dd3a6e389d074bd4de4fcc (patch) | |
tree | 65fef57d39c7c14b73652de26b3653b528ee6450 /os/rt/src/chschd.c | |
parent | 4de725748239e122b27ff2b31aac32b835e8a2d6 (diff) | |
download | ChibiOS-57585301af1df353c3dd3a6e389d074bd4de4fcc.tar.gz ChibiOS-57585301af1df353c3dd3a6e389d074bd4de4fcc.tar.bz2 ChibiOS-57585301af1df353c3dd3a6e389d074bd4de4fcc.zip |
More MISRA.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7726 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src/chschd.c')
-rw-r--r-- | os/rt/src/chschd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c index ba377ac4a..6775b1a12 100644 --- a/os/rt/src/chschd.c +++ b/os/rt/src/chschd.c @@ -436,7 +436,7 @@ bool chSchIsPreemptionRequired(void) { if the first thread on the ready queue has a higher priority.
Otherwise, if the running thread has used up its time quantum, reschedule
if the first thread on the ready queue has equal or higher priority.*/
- return currp->p_preempt ? p1 > p2 : p1 >= p2;
+ return (currp->p_preempt > 0U) ? (p1 > p2) : (p1 >= p2);
#else
/* If the round robin preemption feature is not enabled then performs a
simpler comparison.*/
@@ -526,7 +526,7 @@ void chSchDoReschedule(void) { #if CH_CFG_TIME_QUANTUM > 0
/* If CH_CFG_TIME_QUANTUM is enabled then there are two different scenarios
to handle on preemption: time quantum elapsed or not.*/
- if (currp->p_preempt == 0) {
+ if (currp->p_preempt == 0U) {
/* The thread consumed its time quantum so it is enqueued behind threads
with same priority level, however, it acquires a new time quantum.*/
chSchDoRescheduleBehind();
|