summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-07-30 10:13:14 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-13 08:23:57 +0000
commit9cced0d0ee574caad85c856519e0399f5e1f569d (patch)
tree90e31606dcae96f4c71427644f194eb9fa4b1caa
parent166a07d1d64a9aed1bfecc8ba0cd73354a8dbd60 (diff)
downloadvboot-9cced0d0ee574caad85c856519e0399f5e1f569d.tar.gz
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 <kitching@google.com> Cq-Depend: chromium:1728116 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728294 Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--firmware/2lib/include/2return_codes.h2
-rw-r--r--firmware/lib/vboot_api_kernel.c2
-rw-r--r--tests/vboot_api_kernel5_tests.c4
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();