parser: get rid of useless is_time variable
authorJens Axboe <jaxboe@fusionio.com>
Sun, 27 Mar 2011 18:43:20 +0000 (20:43 +0200)
committerJens Axboe <jaxboe@fusionio.com>
Sun, 27 Mar 2011 18:43:20 +0000 (20:43 +0200)
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
parse.c

diff --git a/parse.c b/parse.c
index bb138e55f967fbeb6aa09690b79fa4b18092cbb4..e9eb73852dbccbeb630b415db7220678054553ad 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -309,7 +309,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
        long long ull, *ullp;
        long ul1, ul2;
        char **cp;
        long long ull, *ullp;
        long ul1, ul2;
        char **cp;
-       int ret = 0, is_time = 0;
+       int ret = 0;
 
        dprint(FD_PARSE, "__handle_option=%s, type=%d, ptr=%s\n", o->name,
                                                        o->type, ptr);
 
        dprint(FD_PARSE, "__handle_option=%s, type=%d, ptr=%s\n", o->name,
                                                        o->type, ptr);
@@ -357,17 +357,14 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                        ret = fn(data, ptr);
                break;
        }
                        ret = fn(data, ptr);
                break;
        }
-       case FIO_OPT_STR_VAL_TIME:
-               is_time = 1;
-       case FIO_OPT_INT:
-       case FIO_OPT_STR_VAL: {
-               fio_opt_str_val_fn *fn = o->cb;
+       case FIO_OPT_STR_VAL_TIME: {
+               fio_opt_str_val_fn *fn;
 
 
-               if (is_time)
-                       ret = check_str_time(ptr, &ull);
-               else
-                       ret = check_str_bytes(ptr, &ull, data);
+               ret = check_str_time(ptr, &ull);
+       case FIO_OPT_INT:
+       case FIO_OPT_STR_VAL:
 
 
+               ret = check_str_bytes(ptr, &ull, data);
                if (ret)
                        break;
 
                if (ret)
                        break;
 
@@ -382,6 +379,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                        return 1;
                }
 
                        return 1;
                }
 
+               fn = o->cb;
                if (fn)
                        ret = fn(data, &ull);
                else {
                if (fn)
                        ret = fn(data, &ull);
                else {