summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2022-02-16 15:40:13 -0700
committerCommit Bot <commit-bot@chromium.org>2022-02-17 02:51:29 +0000
commit549f1e3362836ba5b0a0cb433526049acde4b9be (patch)
treeaad6ed73b6861d7fd6438bb8a491cc88b21d0bc9
parent93bf1f487c2459bb7f0442c68ea4a426541aaf2b (diff)
downloadchrome-ec-549f1e3362836ba5b0a0cb433526049acde4b9be.tar.gz
zephyr: Fix broken tests when coverage is enabled
While zmake testall was passing, zmake coverage was not. Probably because of branch coverage calculation, if an if statement includes both a const portion and a non-const portion, the const portion must be first, or it won't get optimized out. BRANCH=None BUG=b:219862697 TEST=zmake -j8 coverage build/zcoverage Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I97c9aeab737702541b94b7867e02f943beb559c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3470261 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Al Semjonovs <asemjonovs@google.com>
-rw-r--r--common/system.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/system.c b/common/system.c
index a4d18c350d..1e8bfe15a5 100644
--- a/common/system.c
+++ b/common/system.c
@@ -596,7 +596,7 @@ static void jump_to_image(uintptr_t init_addr)
* check whether PD tasks have started (instead of VBOOT_EFS2, which
* is static).
*/
- if (task_start_called() && IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP))
+ if (IS_ENABLED(CONFIG_USB_PD_ALT_MODE_DFP) && task_start_called())
/* Note: must be before i2c module is locked down */
pd_prepare_sysjump();