From 970820e92d1d903643758866a7afbad84145b614 Mon Sep 17 00:00:00 2001 From: Maksim Masalski Date: Tue, 25 May 2021 14:40:14 +0800 Subject: [PATCH] sched: create unique function name 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 --- kernel/sched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched.c b/kernel/sched.c index 1f68f96d5bd..3b5dfc5e29e 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -573,7 +573,7 @@ static inline void z_vrfy_k_thread_resume(struct k_thread *thread) #include #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); @@ -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; }