Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/47064 )
Change subject: fmap.c: inline fmap_find() ......................................................................
fmap.c: inline fmap_find()
Change-Id: I2925cf62465ea35faf76b8d570eb886091250c07 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M fmap.c 1 file changed, 2 insertions(+), 10 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/64/47064/1
diff --git a/fmap.c b/fmap.c index b3d8542..8155aa3 100644 --- a/fmap.c +++ b/fmap.c @@ -153,14 +153,6 @@ return 0; }
-int fmap_find(struct fmap *fmap) -{ - if (!is_valid_fmap(fmap)) - return 0; - - return fmap_size(fmap); -} - static int fmap_lsearch_rom(struct fmap **fmap_out, struct flashctx *const flashctx, size_t rom_offset, size_t len) { @@ -554,9 +546,9 @@ __LINE__, (intmax_t)offset); return -1; } - int buf_size = fmap_find(&fmap_header); - if (buf_size == 0) + if (!is_valid_fmap(&fmap_header)) continue; + int buf_size = fmap_size(&fmap_header); buf = calloc(1, buf_size);
if (read_chunk(source_handle, buf, offset, buf_size)) {