aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/include
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2016-01-04 15:11:17 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2016-01-04 15:11:17 +0000
commit788175c0883ca8b9aa5c46918c98cd906efdeb9b (patch)
tree7cc13ab262a83f3c2140e10231e4694c4e565ea1 /os/hal/include
parent5c2d43e6912254b2a51c01e6bb6e285d1dfc40ca (diff)
downloadChibiOS-788175c0883ca8b9aa5c46918c98cd906efdeb9b.tar.gz
ChibiOS-788175c0883ca8b9aa5c46918c98cd906efdeb9b.tar.bz2
ChibiOS-788175c0883ca8b9aa5c46918c98cd906efdeb9b.zip
HAL MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8687 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r--os/hal/include/hal_buffers.h16
-rw-r--r--os/hal/include/hal_queues.h12
-rw-r--r--os/hal/include/uart.h6
-rw-r--r--os/hal/include/wdg.h2
4 files changed, 22 insertions, 14 deletions
diff --git a/os/hal/include/hal_buffers.h b/os/hal/include/hal_buffers.h
index c7f731f83..bedc56c56 100644
--- a/os/hal/include/hal_buffers.h
+++ b/os/hal/include/hal_buffers.h
@@ -132,7 +132,7 @@ typedef io_buffers_queue_t output_buffers_queue_t;
* @param[in] size size of the buffers
*/
#define BQ_BUFFER_SIZE(n, size) \
- (((size_t)(size) + (sizeof (size_t)) * (size_t)(n)))
+ ((size_t)(size) + ((sizeof (size_t)) * (size_t)(n)))
/**
* @name Macro Functions
@@ -192,8 +192,10 @@ typedef io_buffers_queue_t output_buffers_queue_t;
*
* @iclass
*/
-#define ibqIsFullI(ibqp) ((bool)(((ibqp)->bwrptr == (ibqp)->brdptr) && \
- ((ibqp)->bcounter != 0U)))
+#define ibqIsFullI(ibqp) \
+ /*lint -save -e9007 [13.5] No side effects, a pointer is passed.*/ \
+ ((bool)(((ibqp)->bwrptr == (ibqp)->brdptr) && ((ibqp)->bcounter != 0U))) \
+ /*lint -restore*/
/**
* @brief Evaluates to @p true if the specified output buffers queue is empty.
@@ -205,8 +207,10 @@ typedef io_buffers_queue_t output_buffers_queue_t;
*
* @iclass
*/
-#define obqIsEmptyI(obqp) ((bool)(((obqp)->bwrptr == (obqp)->brdptr) && \
- ((obqp)->bcounter != 0U)))
+#define obqIsEmptyI(obqp) \
+ /*lint -save -e9007 [13.5] No side effects, a pointer is passed.*/ \
+ ((bool)(((obqp)->bwrptr == (obqp)->brdptr) && ((obqp)->bcounter != 0U))) \
+ /*lint -restore*/
/**
* @brief Evaluates to @p true if the specified output buffers queue is full.
@@ -228,7 +232,7 @@ typedef io_buffers_queue_t output_buffers_queue_t;
#ifdef __cplusplus
extern "C" {
#endif
- void ibqObjectInit(io_buffers_queue_t *ibqp, uint8_t *bp,
+ void ibqObjectInit(input_buffers_queue_t *ibqp, uint8_t *bp,
size_t size, size_t n,
bqnotify_t infy, void *link);
void ibqResetI(input_buffers_queue_t *ibqp);
diff --git a/os/hal/include/hal_queues.h b/os/hal/include/hal_queues.h
index 42d70953a..144a4a123 100644
--- a/os/hal/include/hal_queues.h
+++ b/os/hal/include/hal_queues.h
@@ -174,8 +174,10 @@ typedef io_queue_t input_queue_t;
*
* @iclass
*/
-#define iqIsFullI(iqp) ((bool)(((iqp)->q_wrptr == (iqp)->q_rdptr) && \
- ((iqp)->q_counter != 0U)))
+#define iqIsFullI(iqp) \
+ /*lint -save -e9007 [13.5] No side effects, a pointer is passed.*/ \
+ ((bool)(((iqp)->q_wrptr == (iqp)->q_rdptr) && ((iqp)->q_counter != 0U))) \
+ /*lint -restore*/
/**
* @brief Input queue read.
@@ -240,8 +242,10 @@ typedef io_queue_t output_queue_t;
*
* @iclass
*/
-#define oqIsEmptyI(oqp) ((bool)(((oqp)->q_wrptr == (oqp)->q_rdptr) && \
- ((oqp)->q_counter != 0U)))
+#define oqIsEmptyI(oqp) \
+ /*lint -save -e9007 [13.5] No side effects, a pointer is passed.*/ \
+ ((bool)(((oqp)->q_wrptr == (oqp)->q_rdptr) && ((oqp)->q_counter != 0U))) \
+ /*lint -restore*/
/**
* @brief Evaluates to @p true if the specified output queue is full.
diff --git a/os/hal/include/uart.h b/os/hal/include/uart.h
index 2942636b4..a6a8c4298 100644
--- a/os/hal/include/uart.h
+++ b/os/hal/include/uart.h
@@ -321,11 +321,11 @@ extern "C" {
size_t uartStopReceiveI(UARTDriver *uartp);
#if UART_USE_WAIT == TRUE
msg_t uartSendTimeout(UARTDriver *uartp, size_t *np,
- const void *txbuf, systime_t time);
+ const void *txbuf, systime_t timeout);
msg_t uartSendFullTimeout(UARTDriver *uartp, size_t *np,
- const void *txbuf, systime_t time);
+ const void *txbuf, systime_t timeout);
msg_t uartReceiveTimeout(UARTDriver *uartp, size_t *np,
- void *rxbuf, systime_t time);
+ void *rxbuf, systime_t timeout);
#endif
#if UART_USE_MUTUAL_EXCLUSION == TRUE
void uartAcquireBus(UARTDriver *uartp);
diff --git a/os/hal/include/wdg.h b/os/hal/include/wdg.h
index 764e0b2b1..b94575915 100644
--- a/os/hal/include/wdg.h
+++ b/os/hal/include/wdg.h
@@ -49,7 +49,7 @@
typedef enum {
WDG_UNINIT = 0, /**< Not initialized. */
WDG_STOP = 1, /**< Stopped. */
- WDG_READY = 2, /**< Ready. */
+ WDG_READY = 2 /**< Ready. */
} wdgstate_t;
#include "wdg_lld.h"