summaryrefslogtreecommitdiff
path: root/trusty/coverage/coverage.cpp
diff options
context:
space:
mode:
authorBernie Innocenti <codewiz@google.com>2020-12-19 21:17:16 +0900
committerBernie Innocenti <codewiz@google.com>2020-12-19 21:17:16 +0900
commit62ba2b11b18575dcf9d8a2079b52efbb549ae0d8 (patch)
tree068a5dce6c6a9aa08b35a0955013095a6ae62855 /trusty/coverage/coverage.cpp
parentcf110de8d27c3a9572f7cd3ab3c74b6b38c3f94c (diff)
Add explicit Result::has_value() checks where needed
Test: m checkbuild continuous_instrumentation_tests continuous_instrumentation_tests_api_coverage continuous_native_tests device-tests platform_tests Change-Id: Ifd5dcda48e370d750e243d427e68a77dce333951
Diffstat (limited to 'trusty/coverage/coverage.cpp')
-rw-r--r--trusty/coverage/coverage.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/trusty/coverage/coverage.cpp b/trusty/coverage/coverage.cpp
index 9413ce385..f383dd14a 100644
--- a/trusty/coverage/coverage.cpp
+++ b/trusty/coverage/coverage.cpp
@@ -142,7 +142,7 @@ Result<void> CoverageRecord::Open() {
void CoverageRecord::ResetFullRecord() {
auto header_region = GetRegionBounds(COV_START);
- if (!header_region) {
+ if (!header_region.ok()) {
// If the header cannot be parsed, we can't reset the proper region yet.
return;
}
@@ -202,7 +202,7 @@ void CoverageRecord::GetRawData(volatile void** begin, volatile void** end) {
void CoverageRecord::GetRawCounts(volatile uint8_t** begin, volatile uint8_t** end) {
auto region = GetRegionBounds(COV_8BIT_COUNTERS);
- if (!region) {
+ if (!region.ok()) {
*begin = 0;
*end = 0;
return;
@@ -216,7 +216,7 @@ void CoverageRecord::GetRawCounts(volatile uint8_t** begin, volatile uint8_t** e
void CoverageRecord::GetRawPCs(volatile uintptr_t** begin, volatile uintptr_t** end) {
auto region = GetRegionBounds(COV_INSTR_PCS);
- if (!region) {
+ if (!region.ok()) {
*begin = 0;
*end = 0;
return;