From 57318f0ff4e47394e767d8752cd04a0eb7a89164 Mon Sep 17 00:00:00 2001 From: Sam McNally Date: Tue, 18 Oct 2022 20:31:28 +1100 Subject: host/lib: Add flashrom_read_region() to read just the requested region The region parameter to flashrom_read_image() is essentially unusable in isolation since it reads just the requested region into a buffer sized to the entire flash, at the offset of the region within the flash. Remove its unused region parameter and split the functionality of requesting a region into flashrom_read_region() which stores just the requested region into a buffer sized to the region. BUG=b:253966060 TEST=futility update --detect-model -a works as expected BRANCH=None Signed-off-by: Sam McNally Change-Id: Ibf6c152dd42fbc99c1742fb077bc6aa35feeed08 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3965583 Reviewed-by: Edward O'Callaghan Reviewed-by: Yu-Ping Wu --- futility/updater_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'futility/updater_utils.c') diff --git a/futility/updater_utils.c b/futility/updater_utils.c index a41c4038..978936fa 100644 --- a/futility/updater_utils.c +++ b/futility/updater_utils.c @@ -672,7 +672,7 @@ static int read_flash(struct flashrom_params *params, if (get_config_quirk(QUIRK_EXTERNAL_FLASHROM, cfg)) return external_flashrom(FLASH_READ, params, &cfg->tempfiles); - return flashrom_read_image(params->image, NULL, params->verbose); + return flashrom_read_image(params->image, params->verbose); } static int write_flash(struct flashrom_params *params, -- cgit v1.2.1