t/io_uring: fix 32-bit compile warnings
authorJens Axboe <axboe@kernel.dk>
Sun, 21 Nov 2021 13:50:22 +0000 (06:50 -0700)
committerJens Axboe <axboe@kernel.dk>
Sun, 21 Nov 2021 13:50:22 +0000 (06:50 -0700)
We need to use a 64-bit cast for the shift the the user_data, and
fix the init of minv in the clat percentile calculation.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/io_uring.c

index 7bf215c7188a6269e8a910749c7300c64055660a..a98f78fd4a768af2736edb5c090282947b99e4f1 100644 (file)
@@ -192,7 +192,7 @@ unsigned int calc_clat_percentiles(unsigned long *io_u_plat, unsigned long nr,
        unsigned long *ovals = NULL;
        bool is_last;
 
-       *minv = -1ULL;
+       *minv = -1UL;
        *maxv = 0;
 
        ovals = malloc(len * sizeof(*ovals));
@@ -498,7 +498,7 @@ static void init_io(struct submitter *s, unsigned index)
        sqe->off = offset;
        sqe->user_data = (unsigned long) f->fileno;
        if (stats && stats_running)
-               sqe->user_data |= ((unsigned long)s->clock_index << 32);
+               sqe->user_data |= ((uint64_t)s->clock_index << 32);
 }
 
 static int prep_more_ios_uring(struct submitter *s, int max_ios)