summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-09-30 15:11:32 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-01 19:12:14 +0000
commit92df4552d527746d108c0937c42a3a7c9b013193 (patch)
tree25d204bd93dda65fd3a977fc3cd6993463e67028
parent05c367d9ce44fdc14eaa5c060b9b16dbf7dd6a98 (diff)
downloadchrome-ec-92df4552d527746d108c0937c42a3a7c9b013193.tar.gz
lm4: Fix typo in eeprom code
We don't use the EEPROM block on the LM4 chip, but if we ever do we'll want this off-by-one error fixed. BUG=chrome-os-partner:18343 BRANCH=none TEST=Build bds, since that's the only board which even compiles this code. Pass unit tests. Change-Id: I598f043cf00ebc1eca75fa6e6b7815d85a61e353 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171141
-rw-r--r--chip/lm4/eeprom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/lm4/eeprom.c b/chip/lm4/eeprom.c
index 7b28712afd..2a0fa8935c 100644
--- a/chip/lm4/eeprom.c
+++ b/chip/lm4/eeprom.c
@@ -62,7 +62,7 @@ int eeprom_read(int block, int offset, int size, char *data)
if (block < 0 || block >= block_count ||
offset < 0 || offset > EEPROM_BLOCK_SIZE || offset & 3 ||
- size < 0 || offset + size >= EEPROM_BLOCK_SIZE || size & 3)
+ size < 0 || offset + size > EEPROM_BLOCK_SIZE || size & 3)
return EC_ERROR_UNKNOWN;
rv = wait_for_done();
@@ -89,7 +89,7 @@ int eeprom_write(int block, int offset, int size, const char *data)
if (block < 0 || block >= block_count ||
offset < 0 || offset > EEPROM_BLOCK_SIZE || offset & 3 ||
- size < 0 || offset + size >= EEPROM_BLOCK_SIZE || size & 3)
+ size < 0 || offset + size > EEPROM_BLOCK_SIZE || size & 3)
return EC_ERROR_UNKNOWN;
rv = wait_for_done();