From 10f2dda8ddb69c421ce4e958e54cbd1ab63d5051 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Fri, 19 Aug 2022 02:57:40 +0200 Subject: 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 Change-Id: Icd7e6478848c6f72817da16a5350d450bcc0bb5d Reviewed-on: https://review.coreboot.org/c/flashrom/+/66890 Reviewed-by: Anastasia Klimchuk Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- spi25.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'spi25.c') diff --git a/spi25.c b/spi25.c index 44541063..6d160ebb 100644 --- a/spi25.c +++ b/spi25.c @@ -37,7 +37,7 @@ enum id_type { }; static struct { - int is_cached; + bool is_cached; unsigned char bytes[4]; /* enough to hold largest ID type */ } 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); if (ret) return 0; - id_cache[idty].is_cached = 1; + id_cache[idty].is_cached = true; } 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 (spi_rems(flash, id_cache[REMS].bytes)) return 0; - id_cache[REMS].is_cached = 1; + id_cache[REMS].is_cached = true; } id1 = id_cache[REMS].bytes[0]; @@ -247,7 +247,7 @@ int probe_spi_res2(struct flashctx *flash) if (!id_cache[RES2].is_cached) { if (spi_res(flash, id_cache[RES2].bytes, 2)) return 0; - id_cache[RES2].is_cached = 1; + id_cache[RES2].is_cached = true; } id1 = id_cache[RES2].bytes[0]; @@ -267,7 +267,7 @@ int probe_spi_res3(struct flashctx *flash) if (!id_cache[RES3].is_cached) { if (spi_res(flash, id_cache[RES3].bytes, 3)) 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]; -- cgit v1.2.3