]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
util: remove empty default case in argconfig functions
authorCaleb Sander Mateos <csander@purestorage.com>
Tue, 16 Jul 2024 16:21:04 +0000 (10:21 -0600)
committerDaniel Wagner <wagi@monom.org>
Wed, 17 Jul 2024 14:57:45 +0000 (16:57 +0200)
Both argconfig_parse_type() and argconfig_set_opt_val()
switch on the argument value type and have an empty default case.
This is unnecessary and masks errors from unhandled enum values.
So drop the default cases.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
util/argconfig.c

index f480508766ca9af47eefb2b7664a5b353f53495d..faa20fa77eb5820e48b704428642a8ff48783524 100644 (file)
@@ -208,8 +208,6 @@ static int argconfig_parse_type(struct argconfig_commandline_options *s, struct
        case CFG_FLAG:
                *(bool *)value = true;
                break;
-       default:
-               break;
        }
 
        return ret;
@@ -267,8 +265,6 @@ static void argconfig_set_opt_val(enum argconfig_types type, union argconfig_val
        case CFG_STRING:
                *(char **)val = opt_val->string;
                break;
-       default:
-               break;
        }
 }