diff options
author | David Hendricks <dhendrix@chromium.org> | 2015-06-17 19:52:55 (GMT) |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-06-20 04:55:39 (GMT) |
commit | cf1b60fd249e8d330b26785b09db085817d047ed (patch) | |
tree | 4da37fe74ecb22eaedf279fd0c69957d57d14808 | |
parent | b467bff48543b127282ee92871f507ff7ffae9e9 (diff) | |
download | depthcharge-stabilize-7199.B.tar.gz depthcharge-stabilize-7199.B.tar.xz |
vboot: Minor clean-ups to nvstorage_flash codestabilize-7199.B
Just a few touch-ups:
- Localize a variable to the function it's used in.
- Use memset() instead of a loop to initialize a data blob.
BUG=none
BRANCH=none
TEST=built and booted on veyron_mickey
Change-Id: Ieac825a3ea7fd62192dc3ea1cd31a818df50b1eb
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/278277
Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r-- | src/vboot/callbacks/nvstorage_flash.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/vboot/callbacks/nvstorage_flash.c b/src/vboot/callbacks/nvstorage_flash.c index 3fc39d7..274abd5 100644 --- a/src/vboot/callbacks/nvstorage_flash.c +++ b/src/vboot/callbacks/nvstorage_flash.c @@ -53,9 +53,6 @@ /* FMAP descriptor of the NVRAM area */ static FmapArea nvram_area_descriptor; -/* Pointer to the NVRAM area in the flash mirror buffer. */ -static uint8_t *nvram_area_in_flash; - /* Offset of the actual NVRAM blob offset in the NVRAM block. */ static int nvram_blob_offset; @@ -64,9 +61,10 @@ static uint8_t nvram_cache[VBNV_BLOCK_SIZE]; static int flash_nvram_init(void) { - int area_offset, i, prev_offset, size_limit; + int area_offset, prev_offset, size_limit; static int vbnv_flash_is_initialized = 0; uint8_t empty_nvram_block[sizeof(nvram_cache)]; + uint8_t *nvram_area_in_flash; if (vbnv_flash_is_initialized) return 0; @@ -84,8 +82,7 @@ static int flash_nvram_init(void) } /* Prepare an empty NVRAM block to compare against. */ - for (i = 0; i < sizeof(nvram_cache); i++) - empty_nvram_block[i] = 0xff; + memset(empty_nvram_block, 0xff, sizeof(empty_nvram_block)); /* * Now find the first completely empty NVRAM blob. The actual NVRAM |