diff options
Diffstat (limited to 'src/vendorcode/google/chromeos/vbnv.c')
-rw-r--r-- | src/vendorcode/google/chromeos/vbnv.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/vendorcode/google/chromeos/vbnv.c b/src/vendorcode/google/chromeos/vbnv.c index baccb2313d..9fd97a0362 100644 --- a/src/vendorcode/google/chromeos/vbnv.c +++ b/src/vendorcode/google/chromeos/vbnv.c @@ -59,14 +59,9 @@ static uint8_t crc8_vbnv(const uint8_t *data, int len) return (uint8_t) (crc >> 8); } -/* Reset header and CRC to defaults. */ static void reset_vbnv(uint8_t *vbnv_copy) { memset(vbnv_copy, 0, VBNV_BLOCK_SIZE); - vbnv_copy[HEADER_OFFSET] = HEADER_SIGNATURE | - HEADER_FIRMWARE_SETTINGS_RESET | - HEADER_KERNEL_SETTINGS_RESET; - vbnv_copy[CRC_OFFSET] = crc8_vbnv(vbnv_copy, CRC_OFFSET); } /* Read VBNV data into cache. */ @@ -88,9 +83,8 @@ int verify_vbnv(uint8_t *vbnv_copy) /* * Read VBNV data from configured storage backend. * If VBNV verification fails, reset the vbnv copy. - * Returns 1 if write-back of vbnv copy is required. Else, returns 0. */ -int read_vbnv(uint8_t *vbnv_copy) +void read_vbnv(uint8_t *vbnv_copy) { if (IS_ENABLED(CONFIG_CHROMEOS_VBNV_CMOS)) read_vbnv_cmos(vbnv_copy); @@ -100,11 +94,8 @@ int read_vbnv(uint8_t *vbnv_copy) read_vbnv_flash(vbnv_copy); /* Check data for consistency */ - if (verify_vbnv(vbnv_copy)) - return 0; - - reset_vbnv(vbnv_copy); - return 1; + if (!verify_vbnv(vbnv_copy)) + reset_vbnv(vbnv_copy); } /* |