From fbd65c1f6ae3c802467ab99f4b2fe9c7c084972e Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 3 Mar 2015 11:01:09 +0000 Subject: MISRA-related fixes. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7711 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/src/chmsg.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'os/rt/src/chmsg.c') diff --git a/os/rt/src/chmsg.c b/os/rt/src/chmsg.c index 72f662341..d757efd77 100644 --- a/os/rt/src/chmsg.c +++ b/os/rt/src/chmsg.c @@ -93,11 +93,13 @@ msg_t chMsgSend(thread_t *tp, msg_t msg) { ctp->p_msg = msg; ctp->p_u.wtobjp = &tp->p_msgqueue; msg_insert(ctp, &tp->p_msgqueue); - if (tp->p_state == CH_STATE_WTMSG) + if (tp->p_state == CH_STATE_WTMSG) { chSchReadyI(tp); + } chSchGoSleepS(CH_STATE_SNDMSGQ); msg = ctp->p_u.rdymsg; chSysUnlock(); + return msg; } @@ -119,11 +121,13 @@ thread_t *chMsgWait(void) { thread_t *tp; chSysLock(); - if (!chMsgIsPendingI(currp)) + if (!chMsgIsPendingI(currp)) { chSchGoSleepS(CH_STATE_WTMSG); + } tp = queue_fifo_remove(&currp->p_msgqueue); tp->p_state = CH_STATE_SNDMSG; chSysUnlock(); + return tp; } -- cgit v1.2.3