summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-08-12 11:24:11 +1000
committerEdward O'Callaghan <quasisec@chromium.org>2022-08-25 00:21:53 +0000
commiteb1b1f6f7dc27bb978a8e4577c83b722f770af1e (patch)
treec9635f4f4b3ba91560e6ad382e446b24f4eb9fcc /flashrom.c
parentac7f0c20b816784fca6b21e2a931f55b4089e219 (diff)
downloadflashrom-eb1b1f6f7dc27bb978a8e4577c83b722f770af1e.tar.gz
flashrom-eb1b1f6f7dc27bb978a8e4577c83b722f770af1e.tar.bz2
flashrom-eb1b1f6f7dc27bb978a8e4577c83b722f770af1e.zip
flashrom.c: flatten out write_buf_to_include_args()
write_buf_to_include_args() does not need the whole flashctx, rather it works with a fix layout and buffer. Just pass what state is actually required. BUG=b:242246291 TEST=builds Change-Id: I885c4395356eef27746c66300233f07f4718ccdf Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66644 Reviewed-by: Evan Benn <evanbenn@google.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-by: Sam McNally <sammc@google.com> Reviewed-by: Thomas Heijligen <src@posteo.de>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/flashrom.c b/flashrom.c
index 35fdc7da7..5a6f4e661 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1021,14 +1021,12 @@ out:
* then this will write files using data from the corresponding region in the
* supplied buffer.
*
- * @param flashctx Flash context to be used.
+ * @param layout The layout to be used.
* @param buf Chip-sized buffer to read data from
* @return 0 on success
*/
-int write_buf_to_include_args(const struct flashctx *const flash,
- unsigned char *buf)
+int write_buf_to_include_args(const struct flashrom_layout *const layout, unsigned char *buf)
{
- const struct flashrom_layout *const layout = get_layout(flash);
const struct romentry *entry = NULL;
while ((entry = layout_next_included(layout, entry))) {