]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: ubi: remove unreachable code
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sun, 6 Jan 2019 11:26:28 +0000 (12:26 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 15 Jan 2019 20:28:44 +0000 (15:28 -0500)
It does not make sense to check if argc < 2 a second time, especially after
accessing argv[1].

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
cmd/ubi.c

index a12ac703ebe54ffe840d0452589f16ee2fe1ff20..c511a2fb7601f8d49b2a4353b48f289f04d23770 100644 (file)
--- a/cmd/ubi.c
+++ b/cmd/ubi.c
@@ -472,12 +472,8 @@ static int do_ubi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        if (argc < 2)
                return CMD_RET_USAGE;
 
-       if (strcmp(argv[1], "detach") == 0) {
-               if (argc < 2)
-                       return CMD_RET_USAGE;
-
+       if (strcmp(argv[1], "detach") == 0)
                return ubi_detach();
-       }
 
        if (strcmp(argv[1], "part") == 0) {
                const char *vid_header_offset = NULL;