From 656458dcc316ab75437f24fc03df273f4be2ecd0 Mon Sep 17 00:00:00 2001 From: Aaron Massey Date: Tue, 20 Sep 2022 14:17:38 -0600 Subject: usbc_intr_task: Cond compile pd_shared_alert_task The pd_shared_alert_task() function gets compiled in Zephyr EC regardless of its usage via the CONFIG_HAS_TASK_PD_INT_SHARED resulting in inaccurate coverage results for boards without its usage. Compile pd_shared_alert_task() if one of the following is met: * Using Legacy-EC (No Zephyr) * CONFIG_HAS_TASK_PD_INT_SHARED is enabled BRANCH=none BUG=none TEST=zmake build -a TEST=./twister --clobber -i -T zephyr/test/ TEST=make runhosttests -j TEST=CQ Signed-off-by: Aaron Massey Change-Id: I6c96b3994bb3e5e8d64f3f172012bd42f7fcf21e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3908157 Reviewed-by: Diana Z Code-Coverage: Zoss --- common/usbc_intr_task.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/usbc_intr_task.c b/common/usbc_intr_task.c index 56a96a78e4..3c67ba4102 100644 --- a/common/usbc_intr_task.c +++ b/common/usbc_intr_task.c @@ -143,6 +143,7 @@ BUILD_ASSERT(PD_STATUS_TCPC_ALERT_3 == (PD_STATUS_TCPC_ALERT_0 << 3)); * is not. */ +#if !defined(CONFIG_ZEPHYR) || defined(CONFIG_HAS_TASK_PD_INT_SHARED) void pd_shared_alert_task(void *p) { const int sources_mask = (int)((intptr_t)p); @@ -209,3 +210,4 @@ void pd_shared_alert_task(void *p) } while (have_alerts != 0); } } +#endif /* !CONFIG_ZEPHYR || CONFIG_HAS_TASK_PD_INT_SHARED */ -- cgit v1.2.1