From: Jens Axboe Date: Fri, 26 Aug 2022 13:52:54 +0000 (-0600) Subject: t/io_uring: fix 64-bit cast on 32-bit archs X-Git-Tag: fio-3.32~8 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=9ce84fbd2c8eece4618c46312449210efaf8463c;p=fio.git t/io_uring: fix 64-bit cast on 32-bit archs gcc complains that: t/io_uring.c: In function ‘init_io_pt’: t/io_uring.c:618:52: error: left shift count >= width of type [-Werror=shift-count-overflow] 618 | sqe->user_data |= ((unsigned long)s->clock_index << 32); | ^~ we're shifting more than the size of the type. Cast to a 64-bit value so that it'll work on 32-bit as well. Fixes: 7d04588a7663 ("t/io_uring: add support for async-passthru") Signed-off-by: Jens Axboe --- diff --git a/t/io_uring.c b/t/io_uring.c index 0a90f85c..b90bcf78 100644 --- a/t/io_uring.c +++ b/t/io_uring.c @@ -615,7 +615,7 @@ static void init_io_pt(struct submitter *s, unsigned index) sqe->opcode = IORING_OP_URING_CMD; sqe->user_data = (unsigned long) f->fileno; if (stats) - sqe->user_data |= ((unsigned long)s->clock_index << 32); + sqe->user_data |= ((__u64) s->clock_index << 32ULL); sqe->cmd_op = NVME_URING_CMD_IO; slba = offset >> f->lba_shift; nlb = (bs >> f->lba_shift) - 1;