From 6716f15d7b18284988a9ad9f53712c22c89cc48c Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Mon, 21 Aug 2023 16:07:26 +0800 Subject: [PATCH] testing: Check CONFIG_TLS_NELEM is defined before using it Signed-off-by: Xiang Xiao --- testing/ostest/ostest_main.c | 2 +- testing/ostest/tls.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/testing/ostest/ostest_main.c b/testing/ostest/ostest_main.c index 2f7a05c15..2de06fca2 100644 --- a/testing/ostest/ostest_main.c +++ b/testing/ostest/ostest_main.c @@ -300,7 +300,7 @@ static int user_main(int argc, char *argv[]) check_test_memory_usage(); #endif -#if CONFIG_TLS_NELEM > 0 +#if defined(CONFIG_TLS_NELEM) && CONFIG_TLS_NELEM > 0 /* Test TLS */ tls_test(); diff --git a/testing/ostest/tls.c b/testing/ostest/tls.c index 56c5ecddb..7ae461cc6 100644 --- a/testing/ostest/tls.c +++ b/testing/ostest/tls.c @@ -33,7 +33,7 @@ #include "ostest.h" -#if CONFIG_TLS_NELEM > 0 +#if defined(CONFIG_TLS_NELEM) && CONFIG_TLS_NELEM > 0 /**************************************************************************** * Preprocessor Definitions