From 9f3d7776abe58b674744a2888dc4e627418107c6 Mon Sep 17 00:00:00 2001 From: Christopher Friedt Date: Mon, 1 Jan 2024 13:01:35 -0500 Subject: [PATCH] kernel: dynamic: reduce verbosity in degenerate case k_thread_stack_free() is designed to be called with any pointer value. We return -EINVAL when an attempt is made to free an invalid stack pointer. This change reduces the verbosity in the degenerate case, when the pointer is not obtained via k_thread_stack_alloc(), but otherwise does not affect functionality. If debug log verbosity is not enabled, we save a few bytes in .text / .rodata / .strtab. Signed-off-by: Christopher Friedt --- kernel/dynamic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dynamic.c b/kernel/dynamic.c index df94aaaaefa..b9d34cbb52c 100644 --- a/kernel/dynamic.c +++ b/kernel/dynamic.c @@ -156,7 +156,7 @@ int z_impl_k_thread_stack_free(k_thread_stack_t *stack) k_free(stack); #endif } else { - LOG_ERR("Invalid stack %p", stack); + LOG_DBG("Invalid stack %p", stack); return -EINVAL; }