From b53489d0e4252aafe5ada7466e0b3b7c4ad5aaaf Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Thu, 5 Mar 2015 21:28:51 +0000 Subject: Lots of MISRA-related changes in RT. Not finished yet. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7715 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/src/chdynamic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'os/rt/src/chdynamic.c') diff --git a/os/rt/src/chdynamic.c b/os/rt/src/chdynamic.c index 78a667966..9a0c33303 100644 --- a/os/rt/src/chdynamic.c +++ b/os/rt/src/chdynamic.c @@ -68,9 +68,10 @@ thread_t *chThdAddRef(thread_t *tp) { chSysLock(); - chDbgAssert(tp->p_refs < 255, "too many references"); + chDbgAssert(tp->p_refs < 255U, "too many references"); tp->p_refs++; chSysUnlock(); + return tp; } @@ -98,7 +99,7 @@ void chThdRelease(thread_t *tp) { /* If the references counter reaches zero and the thread is in its terminated state then the memory can be returned to the proper allocator. Of course static threads are not affected.*/ - if ((refs == 0) && (tp->p_state == CH_STATE_FINAL)) { + if ((refs == 0U) && (tp->p_state == CH_STATE_FINAL)) { switch (tp->p_flags & CH_FLAG_MODE_MASK) { #if CH_CFG_USE_HEAP case CH_FLAG_MODE_HEAP: -- cgit v1.2.3