diff options
author | Joel Kitching <kitching@google.com> | 2019-07-31 14:12:30 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-13 04:36:52 +0000 |
commit | e6700f4c70fe72850ae4f3f5df19c9281ebcefc8 (patch) | |
tree | 0f2abff7be99bc140e288058fb2eeab6f8bb8b64 /firmware/lib/vboot_kernel.c | |
parent | a5afd01feb0b4b45adbcd8ab38ab8a2ef2a2ef67 (diff) | |
download | vboot-e6700f4c70fe72850ae4f3f5df19c9281ebcefc8.tar.gz |
vboot: update vboot2 functions to use new vb2_error_t
To make explicit when vboot2 error codes should be returned,
use the new vb2_error_t type on all functions which return
VB2_ERROR_* constants.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Idd3ee8afe8c78347783ce5fa829cb78f1e5719e2
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728113, chromium:1728499
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728292
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_kernel.c')
-rw-r--r-- | firmware/lib/vboot_kernel.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/firmware/lib/vboot_kernel.c b/firmware/lib/vboot_kernel.c index 96461d9f..a8c536d5 100644 --- a/firmware/lib/vboot_kernel.c +++ b/firmware/lib/vboot_kernel.c @@ -126,14 +126,11 @@ static uint32_t get_body_offset(uint8_t *kbuf) * VB2_VERIFY_KERNEL_PREAMBLE_WORKBUF_BYTES bytes. * @return VB2_SUCCESS, or non-zero error code. */ -static int vb2_verify_kernel_vblock(struct vb2_context *ctx, - uint8_t *kbuf, - uint32_t kbuf_size, - const struct vb2_packed_key *kernel_subkey, - const LoadKernelParams *params, - uint32_t min_version, - VbSharedDataKernelPart *shpart, - struct vb2_workbuf *wb) +static vb2_error_t vb2_verify_kernel_vblock( + struct vb2_context *ctx, uint8_t *kbuf, uint32_t kbuf_size, + const struct vb2_packed_key *kernel_subkey, + const LoadKernelParams *params, uint32_t min_version, + VbSharedDataKernelPart *shpart, struct vb2_workbuf *wb) { /* Unpack kernel subkey */ struct vb2_public_key kernel_subkey2; @@ -311,14 +308,11 @@ enum vb2_load_partition_flags { * @param wb Workbuf for data storage * @return VB2_SUCCESS, or non-zero error code. */ -static int vb2_load_partition(struct vb2_context *ctx, - VbExStream_t stream, - const struct vb2_packed_key *kernel_subkey, - uint32_t flags, - LoadKernelParams *params, - uint32_t min_version, - VbSharedDataKernelPart *shpart, - struct vb2_workbuf *wb) +static vb2_error_t vb2_load_partition( + struct vb2_context *ctx, VbExStream_t stream, + const struct vb2_packed_key *kernel_subkey, uint32_t flags, + LoadKernelParams *params, uint32_t min_version, + VbSharedDataKernelPart *shpart, struct vb2_workbuf *wb) { uint64_t read_us = 0, start_ts; struct vb2_workbuf wblocal = *wb; @@ -444,7 +438,7 @@ vb2_error_t LoadKernel(struct vb2_context *ctx, LoadKernelParams *params) uint32_t lowest_version = LOWEST_TPM_VERSION; vb2_error_t retval = VBERROR_UNKNOWN; int recovery = VB2_RECOVERY_LK_UNSPECIFIED; - int rv; + vb2_error_t rv; vb2_workbuf_from_ctx(ctx, &wb); |