Remove debug printf()
[fio.git] / parse.c
diff --git a/parse.c b/parse.c
index 98e623a0162a481e182f9a12c63dfbe69a81ec57..9e3c5b17e6707ae0da22a5c8791d7d20a957a1f4 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -56,20 +56,19 @@ static void show_option_range(struct fio_option *o, FILE *out)
 
 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");
@@ -258,28 +257,6 @@ static int check_int(const char *p, int *val)
        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));            \
@@ -315,7 +292,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                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;
@@ -681,7 +658,7 @@ static char *option_dup_subs(const char *opt)
        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;
        }