Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
layout: Tidy up the include-args API

Move all forward declarations into `layout.h`, use consistent naming.

Change-Id: I0e87c9d91b9bc4d78f9cee98caff6985803f7be7
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/54287
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M cli_classic.c
M flash.h
M layout.c
M layout.h
4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/cli_classic.c b/cli_classic.c
index 3b6fbf8..d69b798 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -857,7 +857,7 @@
free(flashes[i].chip);
}

- layout_cleanup(&include_args);
+ cleanup_include_args(&include_args);
free(filename);
free(fmapfile);
free(referencefile);
diff --git a/flash.h b/flash.h
index c50c892..c6a53b1 100644
--- a/flash.h
+++ b/flash.h
@@ -417,10 +417,6 @@
#define msg_pspew(...) print(FLASHROM_MSG_SPEW, __VA_ARGS__) /* programmer debug spew */
#define msg_cspew(...) print(FLASHROM_MSG_SPEW, __VA_ARGS__) /* chip debug spew */

-/* layout.c */
-int register_include_arg(struct layout_include_args **args, const char *arg);
-void layout_cleanup(struct layout_include_args **args);
-
/* spi.c */
struct spi_command {
unsigned int writecnt;
diff --git a/layout.c b/layout.c
index a043d21..e688f79 100644
--- a/layout.c
+++ b/layout.c
@@ -274,7 +274,7 @@
return overlap_detected;
}

-void layout_cleanup(struct layout_include_args **args)
+void cleanup_include_args(struct layout_include_args **args)
{
struct layout_include_args *tmp;

diff --git a/layout.h b/layout.h
index e62fdf9..0cb8879 100644
--- a/layout.h
+++ b/layout.h
@@ -55,9 +55,12 @@

int layout_from_file(struct flashrom_layout **, const char *name);

+int register_include_arg(struct layout_include_args **args, const char *arg);
+int process_include_args(struct flashrom_layout *l, const struct layout_include_args *const args);
+void cleanup_include_args(struct layout_include_args **args);
+
int get_region_range(struct flashrom_layout *const l, const char *name,
unsigned int *start, unsigned int *len);
-int process_include_args(struct flashrom_layout *l, const struct layout_include_args *const args);
const struct romentry *layout_next_included_region(const struct flashrom_layout *, chipoff_t);
const struct romentry *layout_next_included(const struct flashrom_layout *, const struct romentry *);
const struct romentry *layout_next(const struct flashrom_layout *, const struct romentry *);

To view, visit change 54287. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I0e87c9d91b9bc4d78f9cee98caff6985803f7be7
Gerrit-Change-Number: 54287
Gerrit-PatchSet: 8
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Daniel Campello <campello@chromium.org>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged