1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00

spi25.c: Retype appropriate variables with bool

Use the bool type instead of an integer for appropriate variables, since
this represents their purpose much better.

Signed-off-by: Felix Singer <felixsinger@posteo.net>
Change-Id: Icd7e6478848c6f72817da16a5350d450bcc0bb5d
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66890
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Felix Singer 2022-08-19 02:57:40 +02:00 committed by Anastasia Klimchuk
parent 05ac08f786
commit 10f2dda8dd

10
spi25.c
View File

@ -37,7 +37,7 @@ enum id_type {
}; };
static struct { static struct {
int is_cached; bool is_cached;
unsigned char bytes[4]; /* enough to hold largest ID type */ unsigned char bytes[4]; /* enough to hold largest ID type */
} id_cache[NUM_ID_TYPES]; } id_cache[NUM_ID_TYPES];
@ -167,7 +167,7 @@ static int probe_spi_rdid_generic(struct flashctx *flash, int bytes)
msg_cinfo("%d byte RDID not supported on this SPI controller\n", bytes); msg_cinfo("%d byte RDID not supported on this SPI controller\n", bytes);
if (ret) if (ret)
return 0; return 0;
id_cache[idty].is_cached = 1; id_cache[idty].is_cached = true;
} }
rdid_get_ids(id_cache[idty].bytes, bytes, &id1, &id2); rdid_get_ids(id_cache[idty].bytes, bytes, &id1, &id2);
@ -191,7 +191,7 @@ int probe_spi_rems(struct flashctx *flash)
if (!id_cache[REMS].is_cached) { if (!id_cache[REMS].is_cached) {
if (spi_rems(flash, id_cache[REMS].bytes)) if (spi_rems(flash, id_cache[REMS].bytes))
return 0; return 0;
id_cache[REMS].is_cached = 1; id_cache[REMS].is_cached = true;
} }
id1 = id_cache[REMS].bytes[0]; id1 = id_cache[REMS].bytes[0];
@ -247,7 +247,7 @@ int probe_spi_res2(struct flashctx *flash)
if (!id_cache[RES2].is_cached) { if (!id_cache[RES2].is_cached) {
if (spi_res(flash, id_cache[RES2].bytes, 2)) if (spi_res(flash, id_cache[RES2].bytes, 2))
return 0; return 0;
id_cache[RES2].is_cached = 1; id_cache[RES2].is_cached = true;
} }
id1 = id_cache[RES2].bytes[0]; id1 = id_cache[RES2].bytes[0];
@ -267,7 +267,7 @@ int probe_spi_res3(struct flashctx *flash)
if (!id_cache[RES3].is_cached) { if (!id_cache[RES3].is_cached) {
if (spi_res(flash, id_cache[RES3].bytes, 3)) if (spi_res(flash, id_cache[RES3].bytes, 3))
return 0; return 0;
id_cache[RES3].is_cached = 1; id_cache[RES3].is_cached = true;
} }
id1 = (id_cache[RES3].bytes[0] << 8) | id_cache[RES3].bytes[1]; id1 = (id_cache[RES3].bytes[0] << 8) | id_cache[RES3].bytes[1];