summaryrefslogtreecommitdiff
path: root/common/spi_flash_reg.c
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2021-01-14 01:29:08 -0700
committerCommit Bot <commit-bot@chromium.org>2021-01-15 04:07:55 +0000
commit9e422c3c05fdd324565049b09be27c446f9dc0ca (patch)
treeb4694ca5abc8c1be1000a1efe7a7bd8a02ddd856 /common/spi_flash_reg.c
parent6aa3d78608b681e6374f30747a7f6ab80938bde6 (diff)
downloadchrome-ec-9e422c3c05fdd324565049b09be27c446f9dc0ca.tar.gz
Refactor CONFIG_FLASH_SIZE to CONFIG_FLASH_SIZE_BYTES
In Zephyr CONFIG_FLASH_SIZE is a Kconfig value that is used throughout. The issue is that the units don't match. In Zephyr the value is in KiB instead of bytes. This refactor simply renames CONFIG_FLASH_SIZE in platform/ec to include the unit (via _BYTES). BRANCH=none BUG=b:174873770 TEST=make buildall be generated by the build instead of per board Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I44bf3c7a20fcf62aaa9ae15715be78db4210f384 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2627638 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'common/spi_flash_reg.c')
-rw-r--r--common/spi_flash_reg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/spi_flash_reg.c b/common/spi_flash_reg.c
index 3cee0f3bd4..ee8d31fa06 100644
--- a/common/spi_flash_reg.c
+++ b/common/spi_flash_reg.c
@@ -163,7 +163,7 @@ int spi_flash_protect_to_reg(unsigned int start, unsigned int len, uint8_t *sr1,
return EC_ERROR_INVAL;
/* Invalid data */
- if ((start && !len) || start + len > CONFIG_FLASH_SIZE)
+ if ((start && !len) || start + len > CONFIG_FLASH_SIZE_BYTES)
return EC_ERROR_INVAL;
for (i = 0; i < ARRAY_SIZE(spi_flash_protect_ranges); ++i) {