diff options
Diffstat (limited to 'chip/npcx/flash.c')
-rw-r--r-- | chip/npcx/flash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/npcx/flash.c b/chip/npcx/flash.c index 7afb413c2c..a5f656f8ca 100644 --- a/chip/npcx/flash.c +++ b/chip/npcx/flash.c @@ -329,7 +329,7 @@ static int flash_set_status_for_prot(int reg1, int reg2) static int flash_check_prot_range(unsigned int offset, unsigned int bytes) { /* Invalid value */ - if (offset + bytes > CONFIG_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE_BYTES) return EC_ERROR_INVAL; /* Check if ranges overlap */ if (MAX(addr_prot_start, offset) < MIN(addr_prot_start + @@ -362,7 +362,7 @@ static int flash_check_prot_reg(unsigned int offset, unsigned int bytes) sr2 = flash_get_status2(); /* Invalid value */ - if (offset + bytes > CONFIG_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE_BYTES) return EC_ERROR_INVAL; /* Compute current protect range */ @@ -386,7 +386,7 @@ static int flash_write_prot_reg(unsigned int offset, unsigned int bytes, uint8_t sr2 = flash_get_status2(); /* Invalid values */ - if (offset + bytes > CONFIG_FLASH_SIZE) + if (offset + bytes > CONFIG_FLASH_SIZE_BYTES) return EC_ERROR_INVAL; /* Compute desired protect range */ |