From: Jens Axboe Date: Fri, 5 Mar 2010 09:06:15 +0000 (+0100) Subject: Allow holes in the option posval (possible values) X-Git-Tag: fio-1.38~33 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=a3073f4a296bba2cbd026603fe284341c370bfb0;p=fio.git Allow holes in the option posval (possible values) Signed-off-by: Jens Axboe --- diff --git a/parse.c b/parse.c index 98e623a0..f5a35fbc 100644 --- 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"); @@ -315,7 +314,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;