io_uring/futex: get rid of struct io_futex addr union
authorJens Axboe <axboe@kernel.dk>
Wed, 4 Jun 2025 14:49:32 +0000 (08:49 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Jun 2025 16:31:31 +0000 (10:31 -0600)
Rather than use a union of a u32 and struct futex_waitv user address,
consolidate it into a single void __user pointer instead. This also
makes prep easier to use as the store happens to the member that will
be used.

No functional changes in this patch.

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

index fa374af..5a3991b 100644 (file)
 
 struct io_futex {
        struct file     *file;
-       union {
-               u32 __user                      *uaddr;
-               struct futex_waitv __user       *uwaitv;
-       };
+       void __user     *uaddr;
        unsigned long   futex_val;
        unsigned long   futex_mask;
        unsigned long   futexv_owned;
@@ -186,7 +183,7 @@ int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
        if (!futexv)
                return -ENOMEM;
 
-       ret = futex_parse_waitv(futexv, iof->uwaitv, iof->futex_nr,
+       ret = futex_parse_waitv(futexv, iof->uaddr, iof->futex_nr,
                                io_futex_wakev_fn, req);
        if (ret) {
                kfree(futexv);