t/io_uring: fix warnings for !ARCH_HAVE_CPU_CLOCK
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Feb 2022 16:02:49 +0000 (09:02 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 4 Feb 2022 16:02:49 +0000 (09:02 -0700)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index e8365a79d2f024bf409b90d3e0e2a4f8cc4ac514..faf5978c4abfdb7611fc3daa300141c4b0a83dd6 100644 (file)
@@ -287,6 +287,7 @@ out:
        free(ovals);
 }
 
+#ifdef ARCH_HAVE_CPU_CLOCK
 static unsigned int plat_val_to_idx(unsigned long val)
 {
        unsigned int msb, error_bits, base, offset, idx;
@@ -322,6 +323,7 @@ static unsigned int plat_val_to_idx(unsigned long val)
 
        return idx;
 }
+#endif
 
 static void add_stat(struct submitter *s, int clock_index, int nr)
 {
@@ -789,9 +791,12 @@ static void *submitter_uring_fn(void *data)
 {
        struct submitter *s = data;
        struct io_sq_ring *ring = &s->sq_ring;
-       int ret, prepped, nr_batch;
-
-       nr_batch = submitter_init(s);
+       int ret, prepped;
+#ifdef ARCH_HAVE_CPU_CLOCK
+       int nr_batch = submitter_init(s);
+#else
+       submitter_init(s);
+#endif
 
        prepped = 0;
        do {