]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring: parenthesize io_ring_head_to_buf() expansion
authorYi Xie <xieyi@kylinos.cn>
Thu, 14 May 2026 08:34:43 +0000 (16:34 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 May 2026 13:21:32 +0000 (07:21 -0600)
Wrap the io_ring_head_to_buf() macro value in an extra pair of parentheses
so it is safe when composed into larger expressions, and to satisfy
scripts/checkpatch.pl.

Signed-off-by: Yi Xie <xieyi@kylinos.cn>
Link: https://patch.msgid.link/20260514083443.203387-1-xieyi@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c

index 63061aa1cab945c2b8be220760e69d0426ebf104..dd54e43e9ddf4cd4d464cc83ff10d9d0ea55d7a5 100644 (file)
@@ -21,7 +21,7 @@
 #define MAX_BIDS_PER_BGID (1 << 16)
 
 /* Mapped buffer ring, return io_uring_buf from head */
-#define io_ring_head_to_buf(br, head, mask)    &(br)->bufs[(head) & (mask)]
+#define io_ring_head_to_buf(br, head, mask)    (&(br)->bufs[(head) & (mask)])
 
 struct io_provide_buf {
        struct file                     *file;