If we have libaio support, but not an appropriate CPU clock, then the
build throws a warning on nr_batch being assigned but never used.
Mirror what was done on the io_uring init path and only defined and
set `nr_batch` if we have CPU clock support.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
static void *submitter_aio_fn(void *data)
{
struct submitter *s = data;
- int i, ret, prepped, nr_batch;
+ int i, ret, prepped;
struct iocb **iocbsptr;
struct iocb *iocbs;
struct io_event *events;
-
- nr_batch = submitter_init(s);
+#ifdef ARCH_HAVE_CPU_CLOCK
+ int nr_batch = submitter_init(s);
+#else
+ submitter_init(s);
+#endif
iocbsptr = calloc(depth, sizeof(struct iocb *));
iocbs = calloc(depth, sizeof(struct iocb));