public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] test: cmd: mbr: Remove unreachable code
@ 2023-11-08  3:05 Alexander Gendin
  2023-11-10 16:21 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Gendin @ 2023-11-08  3:05 UTC (permalink / raw)
  To: u-boot@lists.denx.de; +Cc: Tom Rini

Fix Coverity (CID 467404): Control flow issues (DEADCODE).
Fix code indentation.

Reported-by: Coverity (CID 467404)
Signed-off-by: Alexander Gendin <agendin@matrox.com>
---
 test/cmd/mbr.c | 16 +++++++---------
 1 file 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;
+				}
 			}
 		}
 	}
-- 
2.41.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-10 16:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-08  3:05 [PATCH] test: cmd: mbr: Remove unreachable code Alexander Gendin
2023-11-10 16:21 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox