diff options
author | Joel Kitching <kitching@google.com> | 2019-07-29 18:53:38 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-08-13 08:23:55 +0000 |
commit | 9908a9a305699bbca42d0fcff88008ebea522b66 (patch) | |
tree | d9fe6fdbb7c4a30990ec835500b49ff25dfe7729 /firmware/stub | |
parent | cf49e7b6ae5abee0552b596ec11b695b5d15853c (diff) | |
download | vboot-9908a9a305699bbca42d0fcff88008ebea522b66.tar.gz |
vboot: replace VBERROR_UNKNOWN with VB2_ERROR_UNKNOWN
Replace vboot1-style VBERROR_UNKNOWN with VB2_ERROR_UNKNOWN.
BUG=b:124141368, chromium:988410
TEST=make clean && make runtests
BRANCH=none
Change-Id: Icd2158e328142cff69ce94b5396ab021a1f7839c
Signed-off-by: Joel Kitching <kitching@google.com>
Cq-Depend: chromium:1728115
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1722916
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/stub')
-rw-r--r-- | firmware/stub/tpm_lite_stub.c | 7 | ||||
-rw-r--r-- | firmware/stub/vboot_api_stub_stream.c | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/firmware/stub/tpm_lite_stub.c b/firmware/stub/tpm_lite_stub.c index 2e4d8141..dced1448 100644 --- a/firmware/stub/tpm_lite_stub.c +++ b/firmware/stub/tpm_lite_stub.c @@ -225,7 +225,8 @@ vb2_error_t VbExTpmOpen(void) delay.tv_nsec = OPEN_RETRY_DELAY_NS; nanosleep(&delay, NULL); } - return DoError(VBERROR_UNKNOWN, "TPM: Cannot open TPM device %s: %s\n", + return DoError(VB2_ERROR_UNKNOWN, + "TPM: Cannot open TPM device %s: %s\n", device_path, strerror(saved_errno)); } @@ -298,12 +299,12 @@ vb2_error_t VbExTpmGetRandom(uint8_t *buf, uint32_t length) if (urandom_fd < 0) { urandom_fd = open("/dev/urandom", O_RDONLY); if (urandom_fd == -1) { - return VBERROR_UNKNOWN; + return VB2_ERROR_UNKNOWN; } } if (length != read(urandom_fd, buf, length)) { - return VBERROR_UNKNOWN; + return VB2_ERROR_UNKNOWN; } return VB2_SUCCESS; diff --git a/firmware/stub/vboot_api_stub_stream.c b/firmware/stub/vboot_api_stub_stream.c index 6748274a..ae0a6745 100644 --- a/firmware/stub/vboot_api_stub_stream.c +++ b/firmware/stub/vboot_api_stub_stream.c @@ -32,7 +32,7 @@ vb2_error_t VbExStreamOpen(VbExDiskHandle_t handle, uint64_t lba_start, if (!handle) { *stream = NULL; - return VBERROR_UNKNOWN; + return VB2_ERROR_UNKNOWN; } s = malloc(sizeof(*s)); @@ -52,16 +52,16 @@ vb2_error_t VbExStreamRead(VbExStream_t stream, uint32_t bytes, void *buffer) vb2_error_t rv; if (!s) - return VBERROR_UNKNOWN; + return VB2_ERROR_UNKNOWN; /* For now, require reads to be a multiple of the LBA size */ if (bytes % LBA_BYTES) - return VBERROR_UNKNOWN; + return VB2_ERROR_UNKNOWN; /* Fail on overflow */ sectors = bytes / LBA_BYTES; if (sectors > s->sectors_left) - return VBERROR_UNKNOWN; + return VB2_ERROR_UNKNOWN; rv = VbExDiskRead(s->handle, s->sector, sectors, buffer); if (rv != VB2_SUCCESS) |