From 9cced0d0ee574caad85c856519e0399f5e1f569d Mon Sep 17 00:00:00 2001 From: Joel Kitching Date: Tue, 30 Jul 2019 10:13:14 +0800 Subject: vboot: replace VBERROR_INVALID_PARAMETER with vboot2 equivalent Replace vboot1-style VBERROR_INVALID_PARAMETER with vboot2 equivalent VB2_ERROR_INVALID_PARAMETER. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: I46227cd3a7d7ce84654a0093f9d64883c9563381 Signed-off-by: Joel Kitching Cq-Depend: chromium:1728116 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728294 Commit-Queue: Joel Kitching Tested-by: Joel Kitching Reviewed-by: Julius Werner --- firmware/2lib/include/2return_codes.h | 2 -- firmware/lib/vboot_api_kernel.c | 2 +- tests/vboot_api_kernel5_tests.c | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h index adfd3fcc..e800f488 100644 --- a/firmware/2lib/include/2return_codes.h +++ b/firmware/2lib/include/2return_codes.h @@ -80,8 +80,6 @@ enum vb2_return_code { VBERROR_INVALID_BMPFV = 0x10014, /* Invalid screen index */ VBERROR_INVALID_SCREEN_INDEX = 0x10015, - /* Invalid parameter */ - VBERROR_INVALID_PARAMETER = 0x10017, /* VbExBeep() can't make sounds at all */ VBERROR_NO_SOUND = 0x10018, /* VbExBeep() can't make sound in the background */ diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 727abc50..23ee6e8b 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -485,7 +485,7 @@ vb2_error_t VbVerifyMemoryBootImage(struct vb2_context *ctx, struct vb2_gbb_header *gbb = vb2_get_gbb(ctx); if ((boot_image == NULL) || (image_size == 0)) { - retval = VBERROR_INVALID_PARAMETER; + retval = VB2_ERROR_INVALID_PARAMETER; goto fail; } diff --git a/tests/vboot_api_kernel5_tests.c b/tests/vboot_api_kernel5_tests.c index f806c509..82cc0767 100644 --- a/tests/vboot_api_kernel5_tests.c +++ b/tests/vboot_api_kernel5_tests.c @@ -236,13 +236,13 @@ static void VerifyMemoryBootImageTest(void) ResetMocks(); TEST_EQ(VbVerifyMemoryBootImage(&ctx, shared, &kparams, NULL, kernel_buffer_size), - VBERROR_INVALID_PARAMETER, "Empty image"); + VB2_ERROR_INVALID_PARAMETER, "Empty image"); /* Illegal image size. */ ResetMocks(); TEST_EQ(VbVerifyMemoryBootImage(&ctx, shared, &kparams, kernel_buffer, 0), - VBERROR_INVALID_PARAMETER, "Illegal image size"); + VB2_ERROR_INVALID_PARAMETER, "Illegal image size"); /* Key Block Verification Failure */ ResetMocks(); -- cgit v1.2.1