Hello Aaron Durbin,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/39334
to review the following change.
Change subject: cbfs: Remove unused functions ......................................................................
cbfs: Remove unused functions
cbfs_boot_load_stage_by_name() and cbfs_prog_stage_section() are no longer used. Remove them to make refactoring the rest of the CBFS API easier.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: Ie44a9507c4a03499b06cdf82d9bf9c02a8292d5e --- M src/include/cbfs.h M src/lib/cbfs.c 2 files changed, 0 insertions(+), 37 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/39334/1
diff --git a/src/include/cbfs.h b/src/include/cbfs.h index 8cd5713..b0dd5e2 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -26,9 +26,6 @@
/* Return mapping of option ROM found in boot device. NULL on error. */ void *cbfs_boot_map_optionrom(uint16_t vendor, uint16_t device); -/* Load stage by name into memory. Returns entry address on success. NULL on - * failure. */ -void *cbfs_boot_load_stage_by_name(const char *name); /* Locate file by name and optional type. Return 0 on success. < 0 on error. */ int cbfs_boot_locate(struct cbfsf *fh, const char *name, uint32_t *type); /* Map file into memory, returning a pointer to the mapping or NULL on error. @@ -61,11 +58,6 @@ size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset, size_t in_size, void *buffer, size_t buffer_size, uint32_t compression);
-/* Return the size and fill base of the memory pstage will occupy after - * loaded. - */ -size_t cbfs_prog_stage_section(struct prog *pstage, uintptr_t *base); - /* Load stage into memory filling in prog. Return 0 on success. < 0 on error. */ int cbfs_prog_stage_load(struct prog *prog);
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index 685d81d..d57f105 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -212,23 +212,6 @@ return cbfs_map(name, NULL); }
-void *cbfs_boot_load_stage_by_name(const char *name) -{ - struct cbfsf fh; - struct prog stage = PROG_INIT(PROG_UNKNOWN, name); - - if (cbfs_boot_locate(&fh, name, NULL)) - return NULL; - - /* Chain data portion in the prog. */ - cbfs_file_data(prog_rdev(&stage), &fh); - - if (cbfs_prog_stage_load(&stage)) - return NULL; - - return prog_entry(&stage); -} - static size_t _cbfs_load(const char *name, void *buf, size_t buf_size, bool force_ro) { @@ -263,18 +246,6 @@ return _cbfs_load(name, buf, buf_size, true); }
-size_t cbfs_prog_stage_section(struct prog *pstage, uintptr_t *base) -{ - struct cbfs_stage stage; - const struct region_device *fh = prog_rdev(pstage); - - if (rdev_readat(fh, &stage, 0, sizeof(stage)) != sizeof(stage)) - return 0; - - *base = (uintptr_t)stage.load; - return stage.memlen; -} - int cbfs_prog_stage_load(struct prog *pstage) { struct cbfs_stage stage;
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39334 )
Change subject: cbfs: Remove unused functions ......................................................................
Patch Set 1: Code-Review+2
Hello build bot (Jenkins), Aaron Durbin,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/39334
to look at the new patch set (#2).
Change subject: cbfs: Remove unused functions ......................................................................
cbfs: Remove unused functions
cbfs_boot_load_stage_by_name() and cbfs_prog_stage_section() are no longer used. Remove them to make refactoring the rest of the CBFS API easier.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: Ie44a9507c4a03499b06cdf82d9bf9c02a8292d5e --- M src/include/cbfs.h M src/lib/cbfs.c 2 files changed, 0 insertions(+), 38 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/39334/2
Aaron Durbin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39334 )
Change subject: cbfs: Remove unused functions ......................................................................
Patch Set 2: Code-Review+2
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39334 )
Change subject: cbfs: Remove unused functions ......................................................................
Patch Set 2: Code-Review+2
Philipp Deppenwiese has submitted this change. ( https://review.coreboot.org/c/coreboot/+/39334 )
Change subject: cbfs: Remove unused functions ......................................................................
cbfs: Remove unused functions
cbfs_boot_load_stage_by_name() and cbfs_prog_stage_section() are no longer used. Remove them to make refactoring the rest of the CBFS API easier.
Signed-off-by: Julius Werner jwerner@chromium.org Change-Id: Ie44a9507c4a03499b06cdf82d9bf9c02a8292d5e Reviewed-on: https://review.coreboot.org/c/coreboot/+/39334 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Aaron Durbin adurbin@chromium.org Reviewed-by: Patrick Rudolph siro@das-labor.org --- M src/include/cbfs.h M src/lib/cbfs.c 2 files changed, 0 insertions(+), 38 deletions(-)
Approvals: build bot (Jenkins): Verified Aaron Durbin: Looks good to me, approved Patrick Rudolph: Looks good to me, approved
diff --git a/src/include/cbfs.h b/src/include/cbfs.h index 2d16aa7..2fe2ce0 100644 --- a/src/include/cbfs.h +++ b/src/include/cbfs.h @@ -25,9 +25,6 @@
/* Return mapping of option ROM found in boot device. NULL on error. */ void *cbfs_boot_map_optionrom(uint16_t vendor, uint16_t device); -/* Load stage by name into memory. Returns entry address on success. NULL on - * failure. */ -void *cbfs_boot_load_stage_by_name(const char *name); /* Locate file by name and optional type. Return 0 on success. < 0 on error. */ int cbfs_boot_locate(struct cbfsf *fh, const char *name, uint32_t *type); /* Map file into memory leaking the mapping. Only should be used when @@ -51,11 +48,6 @@ size_t cbfs_load_and_decompress(const struct region_device *rdev, size_t offset, size_t in_size, void *buffer, size_t buffer_size, uint32_t compression);
-/* Return the size and fill base of the memory pstage will occupy after - * loaded. - */ -size_t cbfs_prog_stage_section(struct prog *pstage, uintptr_t *base); - /* Load stage into memory filling in prog. Return 0 on success. < 0 on error. */ int cbfs_prog_stage_load(struct prog *prog);
diff --git a/src/lib/cbfs.c b/src/lib/cbfs.c index c712f76..7acfc22 100644 --- a/src/lib/cbfs.c +++ b/src/lib/cbfs.c @@ -179,24 +179,6 @@ return cbfs_boot_map_with_leak(name, CBFS_TYPE_OPTIONROM, NULL); }
-void *cbfs_boot_load_stage_by_name(const char *name) -{ - struct cbfsf fh; - struct prog stage = PROG_INIT(PROG_UNKNOWN, name); - uint32_t type = CBFS_TYPE_STAGE; - - if (cbfs_boot_locate(&fh, name, &type)) - return NULL; - - /* Chain data portion in the prog. */ - cbfs_file_data(prog_rdev(&stage), &fh); - - if (cbfs_prog_stage_load(&stage)) - return NULL; - - return prog_entry(&stage); -} - size_t cbfs_boot_load_file(const char *name, void *buf, size_t buf_size, uint32_t type) { @@ -217,18 +199,6 @@ buf, buf_size, compression_algo); }
-size_t cbfs_prog_stage_section(struct prog *pstage, uintptr_t *base) -{ - struct cbfs_stage stage; - const struct region_device *fh = prog_rdev(pstage); - - if (rdev_readat(fh, &stage, 0, sizeof(stage)) != sizeof(stage)) - return 0; - - *base = (uintptr_t)stage.load; - return stage.memlen; -} - int cbfs_prog_stage_load(struct prog *pstage) { struct cbfs_stage stage;
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/39334 )
Change subject: cbfs: Remove unused functions ......................................................................
Patch Set 3:
Automatic boot test returned (PASS/FAIL/TOTAL): 3/0/3 Emulation targets: EMULATION_QEMU_X86_Q35 using payload TianoCore : SUCCESS : https://lava.9esec.io/r/1240 EMULATION_QEMU_X86_Q35 using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1239 EMULATION_QEMU_X86_I440FX using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/1238
Please note: This test is under development and might not be accurate at all!