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 | |
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')
-rw-r--r-- | os/rt/src/chmemcore.c | 8 | ||||
-rw-r--r-- | os/rt/src/chregistry.c | 4 | ||||
-rw-r--r-- | os/rt/src/chschd.c | 4 | ||||
-rw-r--r-- | os/rt/src/chsys.c | 3 |
4 files changed, 10 insertions, 9 deletions
diff --git a/os/rt/src/chmemcore.c b/os/rt/src/chmemcore.c index 2932e09f9..901fb5828 100644 --- a/os/rt/src/chmemcore.c +++ b/os/rt/src/chmemcore.c @@ -134,8 +134,8 @@ void *chCoreAllocI(size_t size) { chDbgCheckClassI();
size = MEM_ALIGN_NEXT(size);
- /*lint -save -e946 -e947 [18.2, 18.3] Normal pointers arithmetic, it
- is safe.*/
+ /*lint -save -e9033 -e946 -e947 [10.8, 18.2, 18.3] Normal pointers
+ arithmetic, it is safe.*/
if ((size_t)(endmem - nextmem) < size) {
/*lint -restore*/
return NULL;
@@ -155,8 +155,8 @@ void *chCoreAllocI(size_t size) { */
size_t chCoreGetStatusX(void) {
- /*lint -save -e946 -e947 [18.2, 18.3] Normal pointers arithmetic, it
- is safe.*/
+ /*lint -save -e9033 -e946 -e947 [10.8, 18.2, 18.3] Normal pointers
+ arithmetic, it is safe.*/
return (size_t)(endmem - nextmem);
/*lint -restore*/
}
diff --git a/os/rt/src/chregistry.c b/os/rt/src/chregistry.c index 76a5190b4..0b5e01681 100644 --- a/os/rt/src/chregistry.c +++ b/os/rt/src/chregistry.c @@ -65,8 +65,8 @@ /*===========================================================================*/
#define _offsetof(st, m) \
- /*lint -save -e946 -e947 -e9033 -e413 [18.2, 18.3, 10.8 1.3] Normal
- pointers arithmetic, it is safe.*/ \
+ /*lint -save -e9005 -e946 -e947 -e9033 -e413 [11.8, 18.2, 18.3, 10.8 1.3]
+ Normal pointers arithmetic, it is safe.*/ \
((size_t)((char *)&((st *)0)->m - (char *)0)) \
/*lint -restore*/
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();
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c index 4e2102b89..7754e546d 100644 --- a/os/rt/src/chsys.c +++ b/os/rt/src/chsys.c @@ -191,9 +191,10 @@ void chSysTimerHandlerI(void) { #if CH_CFG_TIME_QUANTUM > 0
/* Running thread has not used up quantum yet? */
- if (currp->p_preempt > 0)
+ if (currp->p_preempt > 0U) {
/* Decrement remaining quantum.*/
currp->p_preempt--;
+ }
#endif
#if CH_DBG_THREADS_PROFILING == TRUE
currp->p_time++;
|