aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-06 10:13:59 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-06 10:13:59 +0000
commita380d9ad03f2fcf950dad0f08652a03b738dc0e8 (patch)
tree78dfbd7a271ba17cbb8cd7383a5c7edcb87f448b /os/rt/include
parentb53489d0e4252aafe5ada7466e0b3b7c4ad5aaaf (diff)
downloadChibiOS-a380d9ad03f2fcf950dad0f08652a03b738dc0e8.tar.gz
ChibiOS-a380d9ad03f2fcf950dad0f08652a03b738dc0e8.tar.bz2
ChibiOS-a380d9ad03f2fcf950dad0f08652a03b738dc0e8.zip
More MISRA.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7716 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/include')
-rw-r--r--os/rt/include/chqueues.h17
-rw-r--r--os/rt/include/chregistry.h5
2 files changed, 11 insertions, 11 deletions
diff --git a/os/rt/include/chqueues.h b/os/rt/include/chqueues.h
index ea93708f4..f38a9ff75 100644
--- a/os/rt/include/chqueues.h
+++ b/os/rt/include/chqueues.h
@@ -198,9 +198,12 @@ typedef io_queue_t output_queue_t;
* @param[in] qp pointer to a @p io_queue_t structure.
* @return The buffer size.
*
- * @notapi
+ * @xclass
*/
-#define QSIZE(qp) ((size_t)((qp)->q_top - (qp)->q_buffer))
+#define chQSizeX(qp) \
+ /*lint -save -e946 -e947 -e9033 [18.2, 18.3, 10.8] Perfectly safe.*/ \
+ ((size_t)((qp)->q_top - (qp)->q_buffer)) \
+ /*lint -restore*/
/**
* @brief Queue space.
@@ -284,10 +287,7 @@ static inline size_t chIQGetEmptyI(input_queue_t *iqp) {
chDbgCheckClassI();
- /*lint -save -e946 -e947 -e9033 [18.2, 18.3, 10.8] Perfectly safe pointers
- arithmetic in QSIZE().*/
- return (size_t)(QSIZE(iqp) - chQSpaceI(iqp));
- /*lint -restore*/
+ return (size_t)(chQSizeX(iqp) - chQSpaceI(iqp));
}
/**
@@ -354,10 +354,7 @@ static inline size_t chOQGetFullI(output_queue_t *oqp) {
chDbgCheckClassI();
- /*lint -save -e946 -e947 -e9033 [18.2, 18.3, 10.8] Perfectly safe pointers
- arithmetic in QSIZE().*/
- return (size_t)(QSIZE(oqp) - chQSpaceI(oqp));
- /*lint -restore*/
+ return (size_t)(chQSizeX(oqp) - chQSpaceI(oqp));
}
/**
diff --git a/os/rt/include/chregistry.h b/os/rt/include/chregistry.h
index 002f67d8b..501ae7cd0 100644
--- a/os/rt/include/chregistry.h
+++ b/os/rt/include/chregistry.h
@@ -114,9 +114,12 @@ typedef struct {
* @param[in] tp thread to add to the registry
*/
#define REG_INSERT(tp) { \
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/ \
(tp)->p_newer = (thread_t *)&ch.rlist; \
+ /*lint -restore*/ \
(tp)->p_older = ch.rlist.r_older; \
- (tp)->p_older->p_newer = ch.rlist.r_older = (tp); \
+ (tp)->p_older->p_newer = (tp); \
+ ch.rlist.r_older = (tp); \
}
/*===========================================================================*/