summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gendin <agendin@matrox.com>2023-11-08 03:05:19 +0000
committerTom Rini <trini@konsulko.com>2023-11-10 11:01:10 -0500
commita40f35f0691f862d527ed75329773a24369a5b7e (patch)
treefdd81232545f45fbd7d99e87622d9daa883549e4
parent4808d1633336a98f3c48a94a7e1fcd1e1030a324 (diff)
downloadu-boot-a40f35f0691f862d527ed75329773a24369a5b7e.tar.gz
u-boot-a40f35f0691f862d527ed75329773a24369a5b7e.tar.bz2
u-boot-a40f35f0691f862d527ed75329773a24369a5b7e.zip
test: cmd: mbr: Remove unreachable code
Fix an issue reported by Coverity scan, and fix code indentation. Addresses-Coverity-ID: 467404 ("Control flow issues (DEADCODE)") Signed-off-by: Alexander Gendin <agendin@matrox.com>
-rw-r--r--test/cmd/mbr.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/test/cmd/mbr.c b/test/cmd/mbr.c
index 5d7402154d..46b78e706c 100644
--- a/test/cmd/mbr.c
+++ b/test/cmd/mbr.c
@@ -205,16 +205,14 @@ static unsigned build_mbr_parts(char *buf, size_t buf_size, unsigned num_parts)
bytes_remaining -= cur_str_size;
}
- else if (num_parts == 5) {
- cur_str_size = sizeof(mbr_parts_p5);
- if (cur_str_size + 1 > bytes_remaining)
- return 1;
- strcat(cur_buf, mbr_parts_p5);
- bytes_remaining -= cur_str_size;
+ else if (num_parts == 5) {
+ cur_str_size = sizeof(mbr_parts_p5);
+ if (cur_str_size + 1 > bytes_remaining)
+ return 1;
+ strcat(cur_buf, mbr_parts_p5);
+ bytes_remaining -= cur_str_size;
- }
- else if (num_parts > 5)
- return 1;
+ }
}
}
}