From 5fa9750b80b4fe51f7150e32a42aac4b7f20bb52 Mon Sep 17 00:00:00 2001 From: Sylwester Nawrocki Date: Wed, 7 Oct 2020 19:39:20 +0200 Subject: [PATCH] cmd: Remove unreachable code from netboot_nfs() rcode is always 0 (CMD_RET_SUCCESS) so last bootstage_error() call is never executed. Remove it altogether with the rcode local variable. This supresses following SVACE warning: * UNREACHABLE_CODE: This statement in the source code might be unreachable during program execution. [unreachable] unreachable at cmd/net.c:312 [rcode != 0 is always false because at this program point the variable rcode is always equal to 0] rcode != 0 is always false because at this program point the variable rcode is always equal to 0 at cmd/net.c:309 Change-Id: Idf4759839897a35fb47870bf953d35bcb5f0cad8 Signed-off-by: Sylwester Nawrocki --- cmd/net.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cmd/net.c b/cmd/net.c index a9b5e23..8b1d89d 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -291,7 +291,6 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc, int netboot_nfs(unsigned long addr, const char *filename, unsigned long offset, unsigned long limit) { - int rcode = 0; int size; image_load_addr = addr; @@ -318,12 +317,9 @@ int netboot_nfs(unsigned long addr, const char *filename, } bootstage_mark(BOOTSTAGE_ID_NET_LOADED); + bootstage_mark(BOOTSTAGE_ID_NET_DONE); - if (rcode == CMD_RET_SUCCESS) - bootstage_mark(BOOTSTAGE_ID_NET_DONE); - else - bootstage_error(BOOTSTAGE_ID_NET_DONE_ERR); - return rcode; + return CMD_RET_SUCCESS; } #endif -- 2.7.4