diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2021-10-01 10:49:03 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-10-07 07:54:37 +0000 |
commit | edcc9cd30731fafc410675ac90e3b90f822e1d9f (patch) | |
tree | 805f67cbce91b84ce07501d316389282b07416cc /firmware/2lib/2stub.c | |
parent | 2cf76574dbf57c70da3a835f2a45d5619dc058f5 (diff) | |
download | vboot-edcc9cd30731fafc410675ac90e3b90f822e1d9f.tar.gz |
stub: Print error messages by vb2ex_printf()stabilize-ambassador-14268.43.Bstabilize-14268.67.Bstabilize-14268.52.Bstabilize-14268.51.Brelease-R96-14268.B
CL:3167016 in depthcharge mocks vb2ex_printf() to avoid segmentation
fault when running depthcharge unit tests, but the same problem still
exists for all vboot stub functions that use fprintf() to print error
messages. Instead of mocking all the vb2ex_* functions in depthcharge,
we use a simpler approach: always printing error messages using
vb2ex_printf() (or other equivalences) for vboot stubs.
BUG=b:200234887
TEST=make clean && make runtests
TEST=(depthcharge) make unit-tests
BRANCH=none
Change-Id: Idf758070a61b28284864a698475ca582719f4789
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3199053
Reviewed-by: Jakub Czapiga <czapiga@google.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/2lib/2stub.c')
-rw-r--r-- | firmware/2lib/2stub.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c index 1f3b959d..85534dd6 100644 --- a/firmware/2lib/2stub.c +++ b/firmware/2lib/2stub.c @@ -50,7 +50,7 @@ vb2_error_t vb2ex_read_resource(struct vb2_context *ctx, enum vb2_resource_index index, uint32_t offset, void *buf, uint32_t size) { - fprintf(stderr, "%s: function not implemented\n", __func__); + VB2_DEBUG("function not implemented\n"); return VB2_ERROR_EX_UNIMPLEMENTED; } @@ -60,14 +60,14 @@ vb2_error_t vb2ex_read_resource(struct vb2_context *ctx, __attribute__((weak)) vb2_error_t vb2ex_tpm_clear_owner(struct vb2_context *ctx) { - fprintf(stderr, "%s: function not implemented\n", __func__); + VB2_DEBUG("function not implemented\n"); return VB2_ERROR_EX_UNIMPLEMENTED; } __attribute__((weak)) vb2_error_t vb2ex_tpm_set_mode(enum vb2_tpm_mode mode_val) { - fprintf(stderr, "%s: function not implemented\n", __func__); + VB2_DEBUG("function not implemented\n"); return VB2_ERROR_EX_UNIMPLEMENTED; } |