Skip to content

Commit

Permalink
sched: create unique function name
Browse files Browse the repository at this point in the history
In file include/kernel/thread.h in "struct _thread_base" is a member
called "_wait_q_t *pended_on"
At the same time in file kernel/sched.c is function called
"static _wait_q_t *pended_on()"

Coding scanning tool assigns violation (MISRA R5.9) that static
object reused, because thread.h is included in struct.c file.

I think we can rename function to avoid misreading in the future.

Signed-off-by: Maksim Masalski <[email protected]>
  • Loading branch information
maksimmasalski authored and nashif committed May 25, 2021
1 parent f18b728 commit 970820e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ static inline void z_vrfy_k_thread_resume(struct k_thread *thread)
#include <syscalls/k_thread_resume_mrsh.c>
#endif

static _wait_q_t *pended_on(struct k_thread *thread)
static _wait_q_t *pended_on_thread(struct k_thread *thread)
{
__ASSERT_NO_MSG(thread->base.pended_on);

Expand Down Expand Up @@ -632,7 +632,7 @@ void z_pend_thread(struct k_thread *thread, _wait_q_t *wait_q,

static inline void unpend_thread_no_timeout(struct k_thread *thread)
{
_priq_wait_remove(&pended_on(thread)->waitq, thread);
_priq_wait_remove(&pended_on_thread(thread)->waitq, thread);
z_mark_thread_as_not_pending(thread);
thread->base.pended_on = NULL;
}
Expand Down

0 comments on commit 970820e

Please sign in to comment.