From 2b72cdb4f44fa3828a7cac09f288d94e9ce12ecd Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Mon, 28 Nov 2022 18:00:37 +1100 Subject: internal,board_enable: Remove force_boardenable from globals Make `force_boardenable` stack local to the internal_init() entry-point. It's life-time should not exceed that of the internal's init entry function. Change-Id: I3324681f024003694a5531d9d35bb13d2c583eb0 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/70031 Reviewed-by: Sam McNally Tested-by: build bot (Jenkins) --- internal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal.c') diff --git a/internal.c b/internal.c index f21c4fcb7..808039da9 100644 --- a/internal.c +++ b/internal.c @@ -30,7 +30,6 @@ int is_laptop = 0; bool laptop_ok = false; -bool force_boardenable = false; bool force_boardmismatch = false; enum chipbustype internal_buses_supported = BUS_NONE; @@ -202,6 +201,7 @@ static int internal_init(const struct programmer_cfg *cfg) const char *cb_vendor = NULL; const char *cb_model = NULL; #endif + bool force_boardenable = false; ret = get_params(cfg, &force_boardenable, &force_boardmismatch, @@ -261,7 +261,7 @@ static int internal_init(const struct programmer_cfg *cfg) dmi_init(); /* In case Super I/O probing would cause pretty explosions. */ - board_handle_before_superio(); + board_handle_before_superio(force_boardenable); /* Probe for the Super I/O chip and fill global struct superio. */ probe_superio(); @@ -274,7 +274,7 @@ static int internal_init(const struct programmer_cfg *cfg) #endif /* Check laptop whitelist. */ - board_handle_before_laptop(); + board_handle_before_laptop(force_boardenable); /* * Disable all internal buses by default if we are not sure @@ -300,7 +300,7 @@ static int internal_init(const struct programmer_cfg *cfg) * parallel writes on IT8705F. Also, this handles the manual chip select for Gigabyte's DualBIOS. */ init_superio_ite(cfg); - if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model)) { + if (board_flash_enable(board_vendor, board_model, cb_vendor, cb_model, force_boardenable)) { msg_perr("Aborting to be safe.\n"); ret = 1; goto internal_init_exit; -- cgit v1.2.3