diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-10-06 13:10:56 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-07 21:37:33 +0000 |
commit | 4f6d8ca42115d3c39cbc6a476414df0be629f51e (patch) | |
tree | d1dac4da26ff4ba3dbe6450a48f2c7d8337acb44 /chip/host | |
parent | 08c3a7dbd3592e5fdcf73d314b98d990d0f0a075 (diff) | |
download | chrome-ec-4f6d8ca42115d3c39cbc6a476414df0be629f51e.tar.gz |
ec: Don't declare forward decls as weak
If a function in a header is marked as weak (test_mockable), that tells
the linker that it is ok for the symbol to be missing. We never want
that.
If a function implementation is marked as weak, that tells the linker it
is ok to use a non-weak symbol instead of this one. This is what we want
when we are trying to override functions.
Remove all test_mockables from headers, except for one inline function
that I wasn't sure what to do with.
BRANCH=None
BUG=None
TEST=make -j$(nproc) runhosttests buildall && zmake build -a && \
./twister -v -i --clobber
LOW_COVERAGE_REASON=Added stub get_ap_reset_stats() for tests that
don't care about that function, and it's always unused.
Change-Id: Ic00a897131c93ef134544f26a8e368ce1f78a5de
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3935720
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Tristan Honscheid <honscheid@google.com>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Tristan Honscheid <honscheid@google.com>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'chip/host')
-rw-r--r-- | chip/host/reboot.h | 4 | ||||
-rw-r--r-- | chip/host/system.c | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/chip/host/reboot.h b/chip/host/reboot.h index 1541e42334..e382db0adf 100644 --- a/chip/host/reboot.h +++ b/chip/host/reboot.h @@ -10,10 +10,10 @@ #include <stdnoreturn.h> -#ifndef TEST_FUZZ +#if !(defined(TEST_FUZZ) || defined(CONFIG_ZTEST)) noreturn #endif void emulator_reboot(void); -#endif +#endif /* __CROS_EC_REBOOT_H */ diff --git a/chip/host/system.c b/chip/host/system.c index 4a480faf77..ae650e3f9f 100644 --- a/chip/host/system.c +++ b/chip/host/system.c @@ -280,3 +280,10 @@ void system_pre_init(void) *(uintptr_t *)(__host_flash + CONFIG_RW_MEM_OFF + 4) = (uintptr_t)__rw_jump_resetvec; } + +test_mockable enum ec_error_list +get_ap_reset_stats(struct ap_reset_log_entry *reset_log_entries, + size_t num_reset_log_entries, uint32_t *resets_since_ec_boot) +{ + return EC_ERROR_INVAL; +} |