summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2023-03-08 13:35:19 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-13 23:09:48 +0000
commitffb51adb112867b6b2367d1187cfc96d0d3fc6ac (patch)
treeaf211b2d78ab32cee4163f46ff84204579e30186 /zephyr
parent72a40fac54a35536366038866bd91606a368a320 (diff)
downloadchrome-ec-ffb51adb112867b6b2367d1187cfc96d0d3fc6ac.tar.gz
tasks: Remove use of IS_ENABLED in macro conditions
IS_ENABLED is not meant to be used in macro conditionals according to the documentation: "Note: This macro will only function inside a code block due to the way it checks for unknown values." BUG=None BRANCH=None TEST=Build Change-Id: I407ddfe4f75d51933c9ee4e8f2ea24ec86b47764 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4320980 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/shim/src/tasks.c10
-rw-r--r--zephyr/test/tasks/extra_tasks.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/zephyr/shim/src/tasks.c b/zephyr/shim/src/tasks.c
index 8d00475fd1..2dde7d2610 100644
--- a/zephyr/shim/src/tasks.c
+++ b/zephyr/shim/src/tasks.c
@@ -106,7 +106,7 @@ k_tid_t get_main_thread(void)
test_mockable k_tid_t get_hostcmd_thread(void)
{
-#if IS_ENABLED(HAS_TASK_HOSTCMD)
+#ifdef HAS_TASK_HOSTCMD
if (IS_ENABLED(CONFIG_TASK_HOSTCMD_THREAD_MAIN)) {
return get_main_thread();
}
@@ -130,12 +130,12 @@ k_tid_t task_id_to_thread_id(task_id_t task_id)
case TASK_ID_SYSWORKQ:
return get_sysworkq_thread();
-#if IS_ENABLED(HAS_TASK_HOSTCMD)
+#ifdef HAS_TASK_HOSTCMD
case TASK_ID_HOSTCMD:
return get_hostcmd_thread();
#endif /* HAS_TASK_HOSTCMD */
-#if IS_ENABLED(HAS_TASK_MAIN)
+#ifdef HAS_TASK_MAIN
case TASK_ID_MAIN:
return get_main_thread();
#endif /* HAS_TASK_MAIN */
@@ -162,13 +162,13 @@ task_id_t thread_id_to_task_id(k_tid_t thread_id)
return TASK_ID_SYSWORKQ;
}
-#if IS_ENABLED(HAS_TASK_HOSTCMD)
+#ifdef HAS_TASK_HOSTCMD
if (get_hostcmd_thread() == thread_id) {
return TASK_ID_HOSTCMD;
}
#endif /* HAS_TASK_HOSTCMD */
-#if IS_ENABLED(HAS_TASK_MAIN)
+#ifdef HAS_TASK_MAIN
if (get_main_thread() == thread_id) {
return TASK_ID_MAIN;
}
diff --git a/zephyr/test/tasks/extra_tasks.c b/zephyr/test/tasks/extra_tasks.c
index 47b653dfb2..da89eac316 100644
--- a/zephyr/test/tasks/extra_tasks.c
+++ b/zephyr/test/tasks/extra_tasks.c
@@ -59,7 +59,7 @@ ZTEST_USER(extra_tasks, test_hostcmd_thread_mapping)
k_tid_t hostcmd_thread;
k_tid_t main_thread;
-#if IS_ENABLED(HAS_TASK_HOSTCMD)
+#ifdef HAS_TASK_HOSTCMD
#ifdef CONFIG_TASK_HOSTCMD_THREAD_MAIN
k_thread_name_set(get_main_thread(), "HOSTCMD");
#endif /* CONFIG_TASK_HOSTCMD_THREAD_MAIN */