diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-12 09:28:03 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-03-12 09:28:03 +0000 |
commit | db0b7ae0626ebdfc3cda7bef8bd7bad343cead23 (patch) | |
tree | 8d91763f28c60d249845695c00bbb6aa985d60ed /os/hal/osal | |
parent | fc2af0f5896de947b3c59a9251ac4eef91ed005c (diff) | |
download | ChibiOS-db0b7ae0626ebdfc3cda7bef8bd7bad343cead23.tar.gz ChibiOS-db0b7ae0626ebdfc3cda7bef8bd7bad343cead23.tar.bz2 ChibiOS-db0b7ae0626ebdfc3cda7bef8bd7bad343cead23.zip |
More MISRA.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7760 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/osal')
-rw-r--r-- | os/hal/osal/nil/osal.c | 10 | ||||
-rw-r--r-- | os/hal/osal/nil/osal.h | 15 |
2 files changed, 13 insertions, 12 deletions
diff --git a/os/hal/osal/nil/osal.c b/os/hal/osal/nil/osal.c index b595f1ca1..92c350492 100644 --- a/os/hal/osal/nil/osal.c +++ b/os/hal/osal/nil/osal.c @@ -62,7 +62,7 @@ void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) {
semaphore_t *sp = &tqp->sem;
- if (chSemGetCounterI(&tqp->sem) < 0) {
+ if (chSemGetCounterI(&tqp->sem) < (cnt_t)0) {
thread_reference_t tr = nil.threads;
while (true) {
/* Is this thread waiting on this semaphore?*/
@@ -71,7 +71,7 @@ void osalThreadDequeueNextI(threads_queue_t *tqp, msg_t msg) { chDbgAssert(NIL_THD_IS_WTSEM(tr), "not waiting");
- chSchReadyI(tr, msg);
+ (void) chSchReadyI(tr, msg);
return;
}
tr++;
@@ -96,16 +96,16 @@ void osalThreadDequeueAllI(threads_queue_t *tqp, msg_t msg) { cnt_t cnt;
cnt = sp->cnt;
- sp->cnt = 0;
+ sp->cnt = (cnt_t)0;
tr = nil.threads;
- while (cnt < 0) {
+ while (cnt < (cnt_t)0) {
/* Is this thread waiting on this semaphore?*/
if (tr->u1.semp == sp) {
chDbgAssert(NIL_THD_IS_WTSEM(tr), "not waiting");
cnt++;
- chSchReadyI(tr, msg);
+ (void) chSchReadyI(tr, msg);
}
tr++;
diff --git a/os/hal/osal/nil/osal.h b/os/hal/osal/nil/osal.h index 30bae35f5..9bdd9010c 100644 --- a/os/hal/osal/nil/osal.h +++ b/os/hal/osal/nil/osal.h @@ -120,7 +120,7 @@ /* Derived constants and error checks. */
/*===========================================================================*/
-#if !NIL_CFG_USE_EVENTS
+#if NIL_CFG_USE_EVENTS == FALSE
#error "OSAL requires NIL_CFG_USE_EVENTS=TRUE"
#endif
@@ -188,7 +188,7 @@ typedef struct event_source event_source_t; * @note This type is not part of the OSAL API and is provided
* exclusively as an example and for convenience.
*/
-typedef void (*eventcallback_t)(event_source_t *);
+typedef void (*eventcallback_t)(event_source_t *p);
/**
* @brief Type of an event flags mask.
@@ -508,7 +508,7 @@ static inline void osalSysRestoreStatusX(syssts_t sts) { *
* @xclass
*/
-#if PORT_SUPPORTS_RT || defined(__DOXYGEN__)
+#if (PORT_SUPPORTS_RT == TRUE) || defined(__DOXYGEN__)
static inline void osalSysPolledDelayX(rtcnt_t cycles) {
chSysPolledDelayX(cycles);
@@ -694,7 +694,7 @@ static inline void osalThreadResumeS(thread_reference_t *trp, msg_t msg) { */
static inline void osalThreadQueueObjectInit(threads_queue_t *tqp) {
- chSemObjectInit(&tqp->sem, 0);
+ chSemObjectInit(&tqp->sem, (cnt_t)0);
}
/**
@@ -756,8 +756,9 @@ static inline void osalEventBroadcastFlagsI(event_source_t *esp, osalDbgCheck(esp != NULL);
esp->flags |= flags;
- if (esp->cb != NULL)
+ if (esp->cb != NULL) {
esp->cb(esp);
+ }
}
/**
@@ -811,7 +812,7 @@ static inline void osalEventSetCallback(event_source_t *esp, */
static inline void osalMutexObjectInit(mutex_t *mp) {
- chSemObjectInit((semaphore_t *)mp, 1);
+ chSemObjectInit((semaphore_t *)mp, (cnt_t)1);
}
/**
@@ -825,7 +826,7 @@ static inline void osalMutexObjectInit(mutex_t *mp) { */
static inline void osalMutexLock(mutex_t *mp) {
- chSemWait((semaphore_t *)mp);
+ (void) chSemWait((semaphore_t *)mp);
}
/**
|