aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chdebug.c
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-03 11:01:09 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-03 11:01:09 +0000
commitfbd65c1f6ae3c802467ab99f4b2fe9c7c084972e (patch)
treecafc124edd19ce4f3b676a9de703f7a0aefed409 /os/rt/src/chdebug.c
parent3d1a86e9fb0b9495a726dab534e97c063b5f368b (diff)
downloadChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.tar.gz
ChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.tar.bz2
ChibiOS-fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e.zip
MISRA-related fixes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7711 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src/chdebug.c')
-rw-r--r--os/rt/src/chdebug.c36
1 files changed, 24 insertions, 12 deletions
diff --git a/os/rt/src/chdebug.c b/os/rt/src/chdebug.c
index d749e996a..eef4128d0 100644
--- a/os/rt/src/chdebug.c
+++ b/os/rt/src/chdebug.c
@@ -113,8 +113,9 @@
*/
void _dbg_check_disable(void) {
- if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#1");
+ }
}
/**
@@ -124,8 +125,9 @@ void _dbg_check_disable(void) {
*/
void _dbg_check_suspend(void) {
- if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#2");
+ }
}
/**
@@ -135,8 +137,9 @@ void _dbg_check_suspend(void) {
*/
void _dbg_check_enable(void) {
- if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#3");
+ }
}
/**
@@ -146,8 +149,9 @@ void _dbg_check_enable(void) {
*/
void _dbg_check_lock(void) {
- if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#4");
+ }
_dbg_enter_lock();
}
@@ -158,8 +162,9 @@ void _dbg_check_lock(void) {
*/
void _dbg_check_unlock(void) {
- if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt <= 0))
+ if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt <= 0)) {
chSysHalt("SV#5");
+ }
_dbg_leave_lock();
}
@@ -170,8 +175,9 @@ void _dbg_check_unlock(void) {
*/
void _dbg_check_lock_from_isr(void) {
- if ((ch.dbg.isr_cnt <= 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt <= 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#6");
+ }
_dbg_enter_lock();
}
@@ -182,8 +188,9 @@ void _dbg_check_lock_from_isr(void) {
*/
void _dbg_check_unlock_from_isr(void) {
- if ((ch.dbg.isr_cnt <= 0) || (ch.dbg.lock_cnt <= 0))
+ if ((ch.dbg.isr_cnt <= 0) || (ch.dbg.lock_cnt <= 0)) {
chSysHalt("SV#7");
+ }
_dbg_leave_lock();
}
@@ -195,8 +202,9 @@ void _dbg_check_unlock_from_isr(void) {
void _dbg_check_enter_isr(void) {
port_lock_from_isr();
- if ((ch.dbg.isr_cnt < 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt < 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#8");
+ }
ch.dbg.isr_cnt++;
port_unlock_from_isr();
}
@@ -209,8 +217,9 @@ void _dbg_check_enter_isr(void) {
void _dbg_check_leave_isr(void) {
port_lock_from_isr();
- if ((ch.dbg.isr_cnt <= 0) || (ch.dbg.lock_cnt != 0))
+ if ((ch.dbg.isr_cnt <= 0) || (ch.dbg.lock_cnt != 0)) {
chSysHalt("SV#9");
+ }
ch.dbg.isr_cnt--;
port_unlock_from_isr();
}
@@ -225,8 +234,9 @@ void _dbg_check_leave_isr(void) {
*/
void chDbgCheckClassI(void) {
- if ((ch.dbg.isr_cnt < 0) || (ch.dbg.lock_cnt <= 0))
+ if ((ch.dbg.isr_cnt < 0) || (ch.dbg.lock_cnt <= 0)) {
chSysHalt("SV#10");
+ }
}
/**
@@ -239,8 +249,9 @@ void chDbgCheckClassI(void) {
*/
void chDbgCheckClassS(void) {
- if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt <= 0))
+ if ((ch.dbg.isr_cnt != 0) || (ch.dbg.lock_cnt <= 0)) {
chSysHalt("SV#11");
+ }
}
#endif /* CH_DBG_SYSTEM_STATE_CHECK */
@@ -270,8 +281,9 @@ void _dbg_trace(thread_t *otp) {
ch.dbg.trace_buffer.tb_ptr->se_wtobjp = otp->p_u.wtobjp;
ch.dbg.trace_buffer.tb_ptr->se_state = (uint8_t)otp->p_state;
if (++ch.dbg.trace_buffer.tb_ptr >=
- &ch.dbg.trace_buffer.tb_buffer[CH_DBG_TRACE_BUFFER_SIZE])
+ &ch.dbg.trace_buffer.tb_buffer[CH_DBG_TRACE_BUFFER_SIZE]) {
ch.dbg.trace_buffer.tb_ptr = &ch.dbg.trace_buffer.tb_buffer[0];
+ }
}
#endif /* CH_DBG_ENABLE_TRACE */