static void show_option_values(struct fio_option *o)
{
- int i = 0;
+ int i;
- do {
+ for (i = 0; i < PARSE_MAX_VP; i++) {
const struct value_pair *vp = &o->posval[i];
if (!vp->ival)
- break;
+ continue;
printf("%20s: %-10s", i == 0 ? "valid values" : "", vp->ival);
if (vp->help)
printf(" %s", vp->help);
printf("\n");
- i++;
- } while (i < PARSE_MAX_VP);
+ }
if (i)
printf("\n");
return 1;
}
-static inline int o_match(struct fio_option *o, const char *opt)
-{
- if (!strcmp(o->name, opt))
- return 1;
- else if (o->alias && !strcmp(o->alias, opt))
- return 1;
-
- return 0;
-}
-
-static struct fio_option *find_option(struct fio_option *options,
- const char *opt)
-{
- struct fio_option *o;
-
- for (o = &options[0]; o->name; o++)
- if (o_match(o, opt))
- return o;
-
- return NULL;
-}
-
#define val_store(ptr, val, off, data) \
do { \
ptr = td_var((data), (off)); \
for (i = 0; i < PARSE_MAX_VP; i++) {
vp = &posval[i];
if (!vp->ival || vp->ival[0] == '\0')
- break;
+ continue;
ret = 1;
if (!strncmp(vp->ival, ptr, strlen(vp->ival))) {
ret = 0;
ssize_t nchr = OPT_LEN_MAX;
size_t envlen;
- if (strlen(in) + 1 > OPT_LEN_MAX) {
+ if (strlen(opt) + 1 > OPT_LEN_MAX) {
fprintf(stderr, "OPT_LEN_MAX (%d) is too small\n", OPT_LEN_MAX);
return NULL;
}