diff --git a/fs/procfs/fs_procfsmeminfo.c b/fs/procfs/fs_procfsmeminfo.c index f07a0ece67..852e4a60b2 100644 --- a/fs/procfs/fs_procfsmeminfo.c +++ b/fs/procfs/fs_procfsmeminfo.c @@ -454,6 +454,7 @@ static ssize_t memdump_write(FAR struct file *filep, FAR const char *buffer, size_t buflen) { FAR struct procfs_meminfo_entry_s *entry; + FAR struct meminfo_file_s *procfile; struct mm_memdump_s dump = { PID_MM_ALLOC, @@ -474,7 +475,8 @@ static ssize_t memdump_write(FAR struct file *filep, FAR const char *buffer, /* Recover our private data from the struct file instance */ - DEBUGASSERT(filep->f_priv); + procfile = filep->f_priv; + DEBUGASSERT(procfile); #if CONFIG_MM_BACKTRACE > 0 if (strcmp(buffer, "on") == 0) diff --git a/mm/mm_heap/mm_foreach.c b/mm/mm_heap/mm_foreach.c index 3ee8dda02f..04c886a8e4 100644 --- a/mm/mm_heap/mm_foreach.c +++ b/mm/mm_heap/mm_foreach.c @@ -55,7 +55,6 @@ void mm_foreach(FAR struct mm_heap_s *heap, mm_node_handler_t handler, # define region 0 #endif - UNUSED(prev); DEBUGASSERT(handler); /* Visit each region */ diff --git a/mm/mm_heap/mm_mallinfo.c b/mm/mm_heap/mm_mallinfo.c index f1ca89edbc..090dc93636 100644 --- a/mm/mm_heap/mm_mallinfo.c +++ b/mm/mm_heap/mm_mallinfo.c @@ -65,7 +65,7 @@ static void mallinfo_handler(FAR struct mm_allocnode_s *node, FAR void *arg) else { FAR struct mm_freenode_s *fnode = (FAR void *)node; - UNUSED(fnode); + DEBUGASSERT(nodesize >= MM_MIN_CHUNK); DEBUGASSERT(fnode->blink->flink == fnode); DEBUGASSERT(MM_SIZEOF_NODE(fnode->blink) <= nodesize); diff --git a/mm/mm_heap/mm_memdump.c b/mm/mm_heap/mm_memdump.c index 6b05f17f77..510a178574 100644 --- a/mm/mm_heap/mm_memdump.c +++ b/mm/mm_heap/mm_memdump.c @@ -104,7 +104,7 @@ static void memdump_handler(FAR struct mm_allocnode_s *node, FAR void *arg) else if (dump->pid == PID_MM_FREE) { FAR struct mm_freenode_s *fnode = (FAR void *)node; - UNUSED(fnode); + DEBUGASSERT(nodesize >= MM_MIN_CHUNK); DEBUGASSERT(fnode->blink->flink == fnode); DEBUGASSERT(MM_SIZEOF_NODE(fnode->blink) <= nodesize); diff --git a/sched/init/nx_bringup.c b/sched/init/nx_bringup.c index f812d82471..b9922eb3b6 100644 --- a/sched/init/nx_bringup.c +++ b/sched/init/nx_bringup.c @@ -307,7 +307,6 @@ static inline void nx_start_application(void) posix_spawnattr_t attr; #endif int ret; - UNUSED(ret); #ifdef CONFIG_ETC_ROMFS nx_romfsetc(); diff --git a/sched/sched/sched_removeblocked.c b/sched/sched/sched_removeblocked.c index 292180bf03..74c597c36f 100644 --- a/sched/sched/sched_removeblocked.c +++ b/sched/sched/sched_removeblocked.c @@ -55,10 +55,12 @@ void nxsched_remove_blocked(FAR struct tcb_s *btcb) { + tstate_t task_state = btcb->task_state; + /* Make sure the TCB is in a valid blocked state */ - DEBUGASSERT(btcb->task_state >= FIRST_BLOCKED_STATE && - btcb->task_state <= LAST_BLOCKED_STATE); + DEBUGASSERT(task_state >= FIRST_BLOCKED_STATE && + task_state <= LAST_BLOCKED_STATE); /* Remove the TCB from the blocked task list associated * with this state