From a6bfd920f7157e1bca5fa4224fedb53e70e52c3f Mon Sep 17 00:00:00 2001 From: Adrian Gielniewski Date: Wed, 7 May 2025 12:30:57 +0200 Subject: [PATCH] modules: openthread: fix unused function error Compile `log_translate` function only if `CONFIG_LOG` is defined. Signed-off-by: Adrian Gielniewski --- modules/openthread/platform/logging.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/openthread/platform/logging.c b/modules/openthread/platform/logging.c index 8adf98de053..110bd2ecf54 100644 --- a/modules/openthread/platform/logging.c +++ b/modules/openthread/platform/logging.c @@ -18,6 +18,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME); #include "platform-zephyr.h" +#if defined(CONFIG_LOG) /* Convert OT log level to zephyr log level. */ static inline int log_translate(otLogLevel aLogLevel) { @@ -38,6 +39,7 @@ static inline int log_translate(otLogLevel aLogLevel) return -1; } +#endif void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...) {