kernel: fix usage of KERNEL_COHERENCE macro
Add missing CONFIG_ to KERNEL_COHERENCE usage in code.
Fixes #30380
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
diff --git a/include/spinlock.h b/include/spinlock.h
index 44d4c6a..1666df06 100644
--- a/include/spinlock.h
+++ b/include/spinlock.h
@@ -118,7 +118,7 @@
#ifdef CONFIG_SPIN_VALIDATE
__ASSERT(z_spin_lock_valid(l), "Recursive spinlock %p", l);
-# ifdef KERNEL_COHERENCE
+# ifdef CONFIG_KERNEL_COHERENCE
__ASSERT_NO_MSG(arch_mem_coherent(l));
# endif
#endif
diff --git a/kernel/init.c b/kernel/init.c
index fdfda41..953865b 100644
--- a/kernel/init.c
+++ b/kernel/init.c
@@ -157,7 +157,7 @@
z_init_static_threads();
-#ifdef KERNEL_COHERENCE
+#ifdef CONFIG_KERNEL_COHERENCE
__ASSERT_NO_MSG(arch_mem_coherent(_kernel));
#endif
diff --git a/kernel/sched.c b/kernel/sched.c
index 84a6405..14e6895 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -413,7 +413,7 @@
static void ready_thread(struct k_thread *thread)
{
-#ifdef KERNEL_COHERENCE
+#ifdef CONFIG_KERNEL_COHERENCE
__ASSERT_NO_MSG(arch_mem_coherent(thread));
#endif
@@ -676,7 +676,7 @@
static void pend(struct k_thread *thread, _wait_q_t *wait_q,
k_timeout_t timeout)
{
-#ifdef KERNEL_COHERENCE
+#ifdef CONFIG_KERNEL_COHERENCE
__ASSERT_NO_MSG(arch_mem_coherent(wait_q));
#endif
diff --git a/kernel/thread.c b/kernel/thread.c
index 72810de..c8173bc 100644
--- a/kernel/thread.c
+++ b/kernel/thread.c
@@ -571,7 +571,7 @@
z_init_thread_base(&new_thread->base, prio, _THREAD_PRESTART, options);
stack_ptr = setup_thread_stack(new_thread, stack, stack_size);
-#ifdef KERNEL_COHERENCE
+#ifdef CONFIG_KERNEL_COHERENCE
/* Check that the thread object is safe, but that the stack is
* still cached!
*/
diff --git a/kernel/timeout.c b/kernel/timeout.c
index 8e8da33..f63537c 100644
--- a/kernel/timeout.c
+++ b/kernel/timeout.c
@@ -91,7 +91,7 @@
return;
}
-#ifdef KERNEL_COHERENCE
+#ifdef CONFIG_KERNEL_COHERENCE
__ASSERT_NO_MSG(arch_mem_coherent(to));
#endif