diff options
author | Bill Richardson <wfrichar@chromium.org> | 2014-11-20 14:40:48 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-11-21 22:55:45 +0000 |
commit | 3a3dd502514e74b29f2e897045ba5a5f857db646 (patch) | |
tree | 990b976bb83fa6b5dc3b72ed39262f45498c29e1 | |
parent | 613a2ec3e48dda8c119a71c6a5c5dc99f269c3a8 (diff) | |
download | chrome-ec-3a3dd502514e74b29f2e897045ba5a5f857db646.tar.gz |
Fix errors discovered by new compiler.
The latest gcc picked up a couple out-of-bounds issues, so
"make buildall" was failing. This fixes them.
BUG=none
BRANCH=ToT
TEST=make buildall -j
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/231156
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 905fc1cf6f469581154fe7ed3bc29cf766be1241)
Change-Id: Ieba47b4c5d489ce0655977730c80bd445ba7b9ec
Reviewed-on: https://chromium-review.googlesource.com/231282
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
-rw-r--r-- | chip/mec1322/system.c | 2 | ||||
-rw-r--r-- | common/spi_flash.c | 16 | ||||
-rw-r--r-- | include/spi_flash.h | 7 |
3 files changed, 1 insertions, 24 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index 7031bac28f..e682852935 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -213,7 +213,7 @@ static void system_set_gpio_power(int enabled, uint32_t *backup_gpio_ctl) void system_hibernate(uint32_t seconds, uint32_t microseconds) { int i; - uint32_t int_status[15]; + uint32_t int_status[16]; uint32_t int_block_status; uint32_t nvic_status[3]; char *backup_gpio_ctl; diff --git a/common/spi_flash.c b/common/spi_flash.c index 20e4ce37cb..b68936ef91 100644 --- a/common/spi_flash.c +++ b/common/spi_flash.c @@ -425,22 +425,6 @@ int spi_flash_write(unsigned int offset, unsigned int bytes, } /** - * Returns the SPI flash manufacturer ID and device ID [8:0] - * - * @return flash manufacturer + device ID or -1 on error - */ -uint16_t spi_flash_get_id(void) -{ - uint8_t cmd[4] = {SPI_FLASH_MFR_DEV_ID, 0, 0, 0}; - uint8_t resp[2]; - - if (spi_transaction(cmd, 4, resp, 2) != EC_SUCCESS) - return -1; - - return (resp[4] << 8) | resp[5]; -} - -/** * Returns the SPI flash JEDEC ID (manufacturer ID, memory type, and capacity) * * @return flash JEDEC ID or -1 on error diff --git a/include/spi_flash.h b/include/spi_flash.h index 50065b101f..9e83ea9e91 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -123,13 +123,6 @@ int spi_flash_write(unsigned int offset, unsigned int bytes, const uint8_t const *data); /** - * Returns the SPI flash manufacturer ID and device ID [8:0] - * - * @return flash manufacturer + device ID - */ -uint16_t spi_flash_get_id(void); - -/** * Returns the SPI flash JEDEC ID (manufacturer ID, memory type, and capacity) * * @return flash JEDEC ID |