summaryrefslogtreecommitdiff
path: root/common/spi_flash_reg.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spi_flash_reg.c')
-rw-r--r--common/spi_flash_reg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/spi_flash_reg.c b/common/spi_flash_reg.c
index 1301e19dc5..569bbd5072 100644
--- a/common/spi_flash_reg.c
+++ b/common/spi_flash_reg.c
@@ -111,7 +111,7 @@ int spi_flash_reg_to_protect(uint8_t sr1, uint8_t sr2, unsigned int *start,
>> 2;
/* Bad pointers or invalid data */
- if (!start || !len || sr1 == -1 || sr2 == -1)
+ if (!start || !len || sr1 == 0xff || sr2 == 0xff)
return EC_ERROR_INVAL;
for (i = 0; i < ARRAY_SIZE(spi_flash_protect_ranges); ++i) {
@@ -159,7 +159,7 @@ int spi_flash_protect_to_reg(unsigned int start, unsigned int len, uint8_t *sr1,
char bp = 0;
/* Bad pointers */
- if (!sr1 || !sr2 || *sr1 == -1 || *sr2 == -1)
+ if (!sr1 || !sr2)
return EC_ERROR_INVAL;
/* Invalid data */