io_uring: fix 32-bit pointer cast warnings
authorJens Axboe <axboe@kernel.dk>
Tue, 3 Mar 2020 02:59:31 +0000 (19:59 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Mar 2020 03:04:21 +0000 (20:04 -0700)
commit897bca3df74967d9fa96933a8bab7280716180fb
tree96b88a92d0a1a67dfd20cf1ed2fd75db769afcb5
parent6312c03657a6bf71ccd7552ed4fc7c0c9e4fc771
io_uring: fix 32-bit pointer cast warnings

Stephen reports:

After merging the block tree, today's linux-next build (arm
multi_v7_defconfig) produced these warnings:

fs/io_uring.c: In function 'io_put_kbuf':
fs/io_uring.c:1651:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1651 |  struct io_buffer *kbuf = (struct io_buffer *) req->rw.addr;
      |                           ^
fs/io_uring.c: In function 'io_rw_buffer_select':
fs/io_uring.c:2209:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 2209 |  struct io_buffer *kbuf = (struct io_buffer *) req->rw.addr;
      |                           ^
fs/io_uring.c:2216:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
 2216 |  req->rw.addr = (u64) kbuf;
      |                 ^
fs/io_uring.c: In function 'io_cleanup_req':
fs/io_uring.c:4897:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 4897 |    kfree((void *)req->rw.addr);
      |          ^

Fix these by casting to/from unsigned long first.

Fixes: 7efcbb97deab ("io_uring: support buffer selection for OP_READ and OP_RECV")
Fixes: 8cab19f460b6 ("io_uring: add IOSQE_BUFFER_SELECT support for IORING_OP_READV")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c