From d2b7fa6174bc4260e496cbf84375c73636914641 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Thu, 4 May 2023 05:18:56 -0700 Subject: io_uring: Remove unnecessary BUILD_BUG_ON In the io_uring_cmd_prep_async() there is an unnecessary compilation time check to check if cmd is correctly placed at field 48 of the SQE. This is unnecessary, since this check is already in place at io_uring_init(): BUILD_BUG_SQE_ELEM(48, __u64, addr3); Remove it and the uring_cmd_pdu_size() function, which is not used anymore. Keith started a discussion about this topic in the following thread: Link: https://lore.kernel.org/lkml/ZDBmQOhbyU0iLhMw@kbusch-mbp.dhcp.thefacebook.com/ Signed-off-by: Breno Leitao Reviewed-by: Christoph Hellwig Reviewed-by: Pavel Begunkov Link: https://lore.kernel.org/r/20230504121856.904491-4-leitao@debian.org Signed-off-by: Jens Axboe --- io_uring/uring_cmd.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'io_uring/uring_cmd.c') diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index ed536d7499db..5e32db48696d 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -70,9 +70,6 @@ int io_uring_cmd_prep_async(struct io_kiocb *req) { struct io_uring_cmd *ioucmd = io_kiocb_to_cmd(req, struct io_uring_cmd); - BUILD_BUG_ON(uring_cmd_pdu_size(0) != 16); - BUILD_BUG_ON(uring_cmd_pdu_size(1) != 80); - memcpy(req->async_data, ioucmd->sqe, uring_sqe_size(req->ctx)); ioucmd->sqe = req->async_data; return 0; -- cgit v1.2.3