Skip to content

Commit a6bfd92

Browse files
adigiekartben
authored andcommitted
modules: openthread: fix unused function error
Compile `log_translate` function only if `CONFIG_LOG` is defined. Signed-off-by: Adrian Gielniewski <[email protected]>
1 parent 37a0e8c commit a6bfd92

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/openthread/platform/logging.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
1818

1919
#include "platform-zephyr.h"
2020

21+
#if defined(CONFIG_LOG)
2122
/* Convert OT log level to zephyr log level. */
2223
static inline int log_translate(otLogLevel aLogLevel)
2324
{
@@ -38,6 +39,7 @@ static inline int log_translate(otLogLevel aLogLevel)
3839

3940
return -1;
4041
}
42+
#endif
4143

4244
void otPlatLog(otLogLevel aLogLevel, otLogRegion aLogRegion, const char *aFormat, ...)
4345
{

0 commit comments

Comments
 (0)