cmd: Remove unreachable code from netboot_nfs() 42/245442/1
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Wed, 7 Oct 2020 17:39:20 +0000 (19:39 +0200)
committerSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 8 Oct 2020 12:10:03 +0000 (14:10 +0200)
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 <s.nawrocki@samsung.com>
cmd/net.c

index 5880bd3b0abc8ee2e8c76f7ea59c4b7e83ff3022..1988a2f56af3532c3c2a160820045b0ab4314e0a 100644 (file)
--- a/cmd/net.c
+++ b/cmd/net.c
@@ -278,7 +278,6 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
 int netboot_nfs(unsigned long addr, const char *filename,
                unsigned long offset, unsigned long limit)
 {
-       int   rcode = 0;
        int   size;
 
        load_addr = addr;
@@ -305,12 +304,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