From 05ac08f786cfd3f3f5b00b5dfb0849056d99245a Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Fri, 19 Aug 2022 03:03:47 +0200 Subject: tree: Retype variable `laptop_ok` with bool Use the bool type instead of an integer for the variable `laptop_ok`, since this represents its purpose much better. Signed-off-by: Felix Singer Change-Id: I5d9fc3516bc2d29f11b056e35b3e5e324ce93423 Reviewed-on: https://review.coreboot.org/c/flashrom/+/66891 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Anastasia Klimchuk --- board_enable.c | 3 ++- chipset_enable.c | 8 ++++---- include/programmer.h | 2 +- internal.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/board_enable.c b/board_enable.c index 3d9ec2156..4903c0ffd 100644 --- a/board_enable.c +++ b/board_enable.c @@ -22,6 +22,7 @@ #include #include +#include #include #include "flash.h" #include "programmer.h" @@ -2292,7 +2293,7 @@ static int p2_not_a_laptop(void) static int p2_whitelist_laptop(void) { is_laptop = 1; - laptop_ok = 1; + laptop_ok = true; msg_pdbg("Whitelisted laptop detected.\n"); return 0; } diff --git a/chipset_enable.c b/chipset_enable.c index ae069894c..d6103c13b 100644 --- a/chipset_enable.c +++ b/chipset_enable.c @@ -826,7 +826,7 @@ static int enable_flash_ich_spi(const struct programmer_cfg *cfg, struct pci_dev /* Suppress unknown laptop warning if we booted from SPI. */ if (boot_buses & BUS_SPI) - laptop_ok = 1; + laptop_ok = true; return 0; } @@ -971,7 +971,7 @@ static int enable_flash_pch100_or_c620(const struct programmer_cfg *cfg, /* Suppress unknown laptop warning if we booted from SPI. */ if (!ret && (boot_buses & BUS_SPI)) - laptop_ok = 1; + laptop_ok = true; _freepci_ret: pci_free_dev(spi_dev); @@ -1087,7 +1087,7 @@ static int enable_flash_silvermont(const struct programmer_cfg *cfg, struct pci_ /* Suppress unknown laptop warning if we booted from SPI. */ if (boot_buses & BUS_SPI) - laptop_ok = 1; + laptop_ok = true; return 0; } @@ -1676,7 +1676,7 @@ static int enable_flash_mcp6x_7x(const struct programmer_cfg *cfg, struct pci_de /* Suppress unknown laptop warning if we booted from SPI. */ if (!ret && want_spi) - laptop_ok = 1; + laptop_ok = true; return ret; } diff --git a/include/programmer.h b/include/programmer.h index abb7cfd64..a7cea5e7f 100644 --- a/include/programmer.h +++ b/include/programmer.h @@ -265,7 +265,7 @@ extern int superio_count; #if CONFIG_INTERNAL == 1 extern int is_laptop; -extern int laptop_ok; +extern bool laptop_ok; extern bool force_boardenable; extern bool force_boardmismatch; void probe_superio(void); diff --git a/internal.c b/internal.c index ce1debeb0..43aa51bcd 100644 --- a/internal.c +++ b/internal.c @@ -28,7 +28,7 @@ #endif int is_laptop = 0; -int laptop_ok = 0; +bool laptop_ok = false; bool force_boardenable = false; bool force_boardmismatch = false; -- cgit v1.2.3