[PATCH] Warn if both option variable offset and callback given
authorJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jan 2007 13:40:27 +0000 (14:40 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 11 Jan 2007 13:40:27 +0000 (14:40 +0100)
If the callback is present, it is preferred to the offsets. So
giving offsets with a callback specified doesn't make sense.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
parse.c

diff --git a/parse.c b/parse.c
index bc308ffe82902f99728890d1108fa6e300c52d42..2105e2b518334645c41ce02761866185e6625601 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -464,7 +464,7 @@ void fill_default_options(void *data, struct fio_option *options)
 
 /*
  * Sanitize the options structure. For now it just sets min/max for bool
 
 /*
  * Sanitize the options structure. For now it just sets min/max for bool
- * values.
+ * values and whether both callback and offsets are given.
  */
 void options_init(struct fio_option *options)
 {
  */
 void options_init(struct fio_option *options)
 {
@@ -475,5 +475,7 @@ void options_init(struct fio_option *options)
                        o->minval = 0;
                        o->maxval = 1;
                }
                        o->minval = 0;
                        o->maxval = 1;
                }
+               if (o->cb && (o->off1 || o->off2 || o->off3 || o->off4))
+                       fprintf(stderr, "Option %s: both cb and offset given\n", o->name);
        }
 }
        }
 }