aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/src')
-rw-r--r--os/rt/src/chheap.c4
-rw-r--r--os/rt/src/chschd.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/os/rt/src/chheap.c b/os/rt/src/chheap.c
index a2635c72d..5214462ce 100644
--- a/os/rt/src/chheap.c
+++ b/os/rt/src/chheap.c
@@ -110,7 +110,7 @@ void chHeapObjectInit(memory_heap_t *heapp, void *buf, size_t size) {
chDbgCheck(MEM_IS_ALIGNED(buf) && MEM_IS_ALIGNED(size));
- heapp->h_provider = (memgetfunc_t)NULL;
+ heapp->h_provider = NULL;
heapp->h_free.h.u.next = hp;
heapp->h_free.h.size = 0;
hp->h.u.next = NULL;
@@ -162,7 +162,7 @@ void *chHeapAlloc(memory_heap_t *heapp, size_t size) {
/* Block bigger enough, must split it.*/
fp = (void *)((uint8_t *)(hp) + sizeof(union heap_header) + size);
fp->h.u.next = hp->h.u.next;
- fp->h.size = hp->h.size - sizeof(union heap_header) - size;
+ fp->h.size = (hp->h.size - sizeof(union heap_header)) - size;
qp->h.u.next = fp;
hp->h.size = size;
}
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c
index 3de92aec8..ba377ac4a 100644
--- a/os/rt/src/chschd.c
+++ b/os/rt/src/chschd.c
@@ -389,9 +389,9 @@ void chSchWakeupS(thread_t *ntp, msg_t msg) {
thread_t *otp = chSchReadyI(currp);
setcurrp(ntp);
#if defined(CH_CFG_IDLE_LEAVE_HOOK)
- if (otp->p_prio == IDLEPRIO) {
- CH_CFG_IDLE_LEAVE_HOOK();
- }
+ if (otp->p_prio == IDLEPRIO) {
+ CH_CFG_IDLE_LEAVE_HOOK();
+ }
#endif
ntp->p_state = CH_STATE_CURRENT;
chSysSwitch(ntp, otp);