From 71989c1b8d102f88c8a34d61c356cd6f0ba680c9 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 11 Feb 2022 06:42:13 -0700 Subject: [PATCH] t/io_uring: avoid unused `nr_batch` warning 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 --- t/io_uring.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/t/io_uring.c b/t/io_uring.c index faf5978c..4520de43 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -714,12 +714,15 @@ static int reap_events_aio(struct submitter *s, struct io_event *events, int evs 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)); -- 2.25.1