From 272b51ba236d6636bda3ee961cba35eb489d30af Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 7 Mar 2015 11:07:31 +0000 Subject: MISRAs done for RT. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7727 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/include/chdebug.h | 2 ++ os/rt/include/chschd.h | 8 ++++---- os/rt/include/chsys.h | 2 ++ os/rt/include/chthreads.h | 2 ++ 4 files changed, 10 insertions(+), 4 deletions(-) (limited to 'os/rt/include') diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h index 2e4b846f3..a839813d7 100644 --- a/os/rt/include/chdebug.h +++ b/os/rt/include/chdebug.h @@ -192,7 +192,9 @@ typedef struct { #if !defined(chDbgAssert) #if CH_DBG_ENABLE_ASSERTS == TRUE #define chDbgAssert(c, r) do { \ + /*lint -save -e506 -e774 [2.1, 14.3] Can be a constant.*/ \ if (!(c)) { \ + /*lint -restore*/ \ chSysHalt(__func__); \ } \ } while (false) diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h index c106dd9b0..78fac0004 100644 --- a/os/rt/include/chschd.h +++ b/os/rt/include/chschd.h @@ -617,10 +617,10 @@ static inline void queue_init(threads_queue_t *tqp) { * * @notapi */ -static inline bool queue_isempty(threads_queue_t *tqp) { +static inline bool queue_isempty(const threads_queue_t *tqp) { /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ - return (bool)(tqp->p_next == (thread_t *)tqp); + return (bool)(tqp->p_next == (const thread_t *)tqp); /*lint -restore*/ } @@ -632,10 +632,10 @@ static inline bool queue_isempty(threads_queue_t *tqp) { * * @notapi */ -static inline bool queue_notempty(threads_queue_t *tqp) { +static inline bool queue_notempty(const threads_queue_t *tqp) { /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ - return (bool)(tqp->p_next != (thread_t *)tqp); + return (bool)(tqp->p_next != (const thread_t *)tqp); /*lint -restore*/ } diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h index 88814fa16..af725f627 100644 --- a/os/rt/include/chsys.h +++ b/os/rt/include/chsys.h @@ -28,6 +28,8 @@ #ifndef _CHSYS_H_ #define _CHSYS_H_ +/*lint -sem(chSysHalt, r_no)*/ + /*===========================================================================*/ /* Module constants. */ /*===========================================================================*/ diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h index 6632d8d62..966f5de08 100644 --- a/os/rt/include/chthreads.h +++ b/os/rt/include/chthreads.h @@ -28,6 +28,8 @@ #ifndef _CHTHREADS_H_ #define _CHTHREADS_H_ +/*lint -sem(chThdExit, r_no) -sem(chThdExitS, r_no)*/ + /*===========================================================================*/ /* Module constants. */ /*===========================================================================*/ -- cgit v1.2.3