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 /builtin | |
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 'builtin')
-rw-r--r-- | builtin/assert.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/assert.h b/builtin/assert.h index b667a0d2a2..2e943f7615 100644 --- a/builtin/assert.h +++ b/builtin/assert.h @@ -11,8 +11,6 @@ /* Include CONFIG definitions for EC sources. */ #ifndef THIRD_PARTY #include "common.h" -#else -#define test_mockable_noreturn noreturn #endif #ifdef __cplusplus @@ -23,7 +21,7 @@ extern "C" { #ifdef CONFIG_DEBUG_ASSERT_REBOOTS #ifdef CONFIG_DEBUG_ASSERT_BRIEF -test_mockable_noreturn void panic_assert_fail(const char *fname, int linenum); +noreturn void panic_assert_fail(const char *fname, int linenum); #define ASSERT(cond) \ do { \ if (!(cond)) \ @@ -32,8 +30,8 @@ test_mockable_noreturn void panic_assert_fail(const char *fname, int linenum); #else /* !CONFIG_DEBUG_ASSERT_BRIEF */ -test_mockable_noreturn void panic_assert_fail(const char *msg, const char *func, - const char *fname, int linenum); +noreturn void panic_assert_fail(const char *msg, const char *func, + const char *fname, int linenum); #define ASSERT(cond) \ do { \ if (!(cond)) \ |