X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=parse.c;h=f4cefcf6243edbd911cb4f274611912c440a5f07;hb=b34eb155e4a6a05dbe43b0f7342a8118d09fdc7c;hp=483a62f680cf8ba3dde1982afdb9aea63bcd6d73;hpb=5cd4efe903798f2185a347911a9440324558c89f;p=fio.git diff --git a/parse.c b/parse.c index 483a62f6..f4cefcf6 100644 --- a/parse.c +++ b/parse.c @@ -596,7 +596,7 @@ static int __handle_option(const struct fio_option *o, const char *ptr, } case FIO_OPT_STR_VAL_TIME: is_time = 1; - /* fall through */ + fallthrough; case FIO_OPT_ULL: case FIO_OPT_INT: case FIO_OPT_STR_VAL: { @@ -941,7 +941,7 @@ static int __handle_option(const struct fio_option *o, const char *ptr, } case FIO_OPT_DEPRECATED: ret = 1; - /* fall through */ + fallthrough; case FIO_OPT_SOFT_DEPRECATED: log_info("Option %s is deprecated\n", o->name); break; @@ -1048,7 +1048,20 @@ struct fio_option *find_option(struct fio_option *options, const char *opt) const struct fio_option * find_option_c(const struct fio_option *options, const char *opt) { - return find_option((struct fio_option *)options, opt); + const struct fio_option *o; + + for (o = &options[0]; o->name; o++) { + if (!o_match(o, opt)) + continue; + if (o->type == FIO_OPT_UNSUPPORTED) { + log_err("Option <%s>: %s\n", o->name, o->help); + continue; + } + + return o; + } + + return NULL; } static const struct fio_option *