HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/33345
Change subject: fmap.c: Remove unneeded 'else' ......................................................................
fmap.c: Remove unneeded 'else'
'else' is not needed after a 'break' or 'return'.
Change-Id: I5df4d8075be012b9edf7be520d611042d9945094 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M fmap.c 1 file changed, 3 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/45/33345/1
diff --git a/fmap.c b/fmap.c index 84b3b54..31f282f 100644 --- a/fmap.c +++ b/fmap.c @@ -132,9 +132,8 @@ if (offset < 0) { msg_gdbg("Unable to find fmap in provided buffer.\n"); return 2; - } else { - msg_gdbg("Found fmap at offset 0x%06zx\n", (size_t)offset); } + msg_gdbg("Found fmap at offset 0x%06zx\n", (size_t)offset);
const struct fmap *fmap = (const struct fmap *)(buf + offset); *fmap_out = malloc(fmap_size(fmap)); @@ -251,10 +250,9 @@ msg_gdbg("fmap found at offset 0x%06zx\n", offset); fmap_found = 1; break; - } else { - msg_gerr("fmap signature found at %zu but header is invalid.\n", offset); - ret = 2; } + msg_gerr("fmap signature found at %zu but header is invalid.\n", offset); + ret = 2; }
if (fmap_found)
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/33345 )
Change subject: fmap.c: Remove unneeded 'else' ......................................................................
Patch Set 1: Code-Review+2
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/c/flashrom/+/33345 )
Change subject: fmap.c: Remove unneeded 'else' ......................................................................
fmap.c: Remove unneeded 'else'
'else' is not needed after a 'break' or 'return'.
Change-Id: I5df4d8075be012b9edf7be520d611042d9945094 Signed-off-by: Elyes HAOUAS ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/flashrom/+/33345 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com --- M fmap.c 1 file changed, 3 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/fmap.c b/fmap.c index 84b3b54..31f282f 100644 --- a/fmap.c +++ b/fmap.c @@ -132,9 +132,8 @@ if (offset < 0) { msg_gdbg("Unable to find fmap in provided buffer.\n"); return 2; - } else { - msg_gdbg("Found fmap at offset 0x%06zx\n", (size_t)offset); } + msg_gdbg("Found fmap at offset 0x%06zx\n", (size_t)offset);
const struct fmap *fmap = (const struct fmap *)(buf + offset); *fmap_out = malloc(fmap_size(fmap)); @@ -251,10 +250,9 @@ msg_gdbg("fmap found at offset 0x%06zx\n", offset); fmap_found = 1; break; - } else { - msg_gerr("fmap signature found at %zu but header is invalid.\n", offset); - ret = 2; } + msg_gerr("fmap signature found at %zu but header is invalid.\n", offset); + ret = 2; }
if (fmap_found)