diff options
author | Moritz Fischer <moritz.fischer@ettus.com> | 2016-12-27 19:31:45 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-01-03 15:13:58 -0800 |
commit | 4234992812588e2901192ca9ec8d94b074c6f5f5 (patch) | |
tree | 224dff3143c9b5db40ff865edfbda3cd273dc6ed | |
parent | 05835a86912bd3beaf1e296739cad83ca89711d3 (diff) | |
download | chrome-ec-4234992812588e2901192ca9ec8d94b074c6f5f5.tar.gz |
pstore: Fix issue with block calculation for pstore blocks
Fix issue where the block is calculated wrong since the offset that gets
added is wrongly EEPROM_BLOCK_COUNT_PSTORE which is the number of
total blocks rather than the starting block given by
EEPROM_BLOCK_START_PSTORE.
TEST=Build test, ran on board with stubbed out functions.
BUG=none
BRANCH=none
Change-Id: Ide4839845353c2b9f95a37eb689c8d800169bb22
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Reviewed-on: https://chromium-review.googlesource.com/424182
Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | common/pstore_commands.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/pstore_commands.c b/common/pstore_commands.c index abc70ea8a8..e130528eee 100644 --- a/common/pstore_commands.c +++ b/common/pstore_commands.c @@ -31,7 +31,7 @@ int pstore_command_read(struct host_cmd_handler_args *args) const struct ec_params_pstore_read *p = args->params; char *dest = args->response; int block_size = eeprom_get_block_size(); - int block = p->offset / block_size + EEPROM_BLOCK_COUNT_PSTORE; + int block = p->offset / block_size + EEPROM_BLOCK_START_PSTORE; int offset = p->offset % block_size; int bytes_left = p->size; @@ -69,7 +69,7 @@ int pstore_command_write(struct host_cmd_handler_args *args) const char *src = p->data; int block_size = eeprom_get_block_size(); - int block = p->offset / block_size + EEPROM_BLOCK_COUNT_PSTORE; + int block = p->offset / block_size + EEPROM_BLOCK_START_PSTORE; int offset = p->offset % block_size; int bytes_left = p->size; |