From 67b5526d5c46bfc4d70fb288b9227097fc113e30 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Mon, 6 Mar 2023 11:25:52 +1100 Subject: internal: Move laptop_ok into board_cfg Due to how internal is structured around chipset_flash_enable() entry we need to prepare a crafted programmer_cfg that contains a board_enable substructure with data derived from the board_enable subsystem. While this is certainly not perfection, it does make clear the relationships between board_enable into chipset_flash_enable and subsequently the overall internal programmer initialisation in a RAII fashion at the type level over closure upon global state that is impossible to reason about. Also flip predicate in report_nonwl_laptop_detected() and return early with the trivial base-case. TEST=`$ sudo ./flashrom -p internal --flash-name`. Change-Id: I459215253845c2af73262943ce91a36464e9eb06 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/73456 Tested-by: build bot (Jenkins) Reviewed-by: Sam McNally --- board_enable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'board_enable.c') diff --git a/board_enable.c b/board_enable.c index f95430a8..d9af44e9 100644 --- a/board_enable.c +++ b/board_enable.c @@ -2293,7 +2293,7 @@ static int p2_not_a_laptop(struct board_cfg *cfg) static int p2_whitelist_laptop(struct board_cfg *cfg) { cfg->is_laptop = 1; - g_laptop_ok = true; + cfg->laptop_ok = true; msg_pdbg("Whitelisted laptop detected.\n"); return 0; } -- cgit v1.2.3