[PATCH v2 1/2] io_uring: Remove compile time asserts

Chris Packham chris.packham at alliedtelesis.co.nz
Mon Jun 15 10:01:25 UTC 2020


The generated types/check-io_uring.c already checks the kernel's struct
io_cqring_offsets for compatibility with the strace definition so
there's no need for manual checks.

* io_uring.c: Remove static_asserts.
---
 io_uring.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/io_uring.c b/io_uring.c
index cd183457..625c113c 100644
--- a/io_uring.c
+++ b/io_uring.c
@@ -18,38 +18,6 @@
 #include "xlat/uring_enter_flags.h"
 #include "xlat/uring_register_opcodes.h"
 
-#ifdef HAVE_STRUCT_IO_CQRING_OFFSETS
-# ifdef HAVE_STRUCT_IO_CQRING_OFFSETS_RESV
-static_assert(offsetof(struct_io_cqring_offsets, resv)
-             >= offsetof(struct io_cqring_offsets, resv),
-             "struct io_cqring_offsets.resv offset mismatch"
-             ", please update the decoder");
-static_assert(sizeof_field(struct_io_cqring_offsets, resv)
-             <= sizeof_field(struct io_cqring_offsets, resv),
-             "struct io_cqring_offsets.resv size mismatch"
-             ", please update the decoder");
-# else /* !HAVE_STRUCT_IO_CQRING_OFFSETS_RESV */
-static_assert(0, "struct io_cqring_offsets.resv is missing"
-		 ", please update the decoder");
-# endif
-#endif /* HAVE_STRUCT_IO_CQRING_OFFSETS */
-#ifdef HAVE_STRUCT_IO_URING_PARAMS
-# ifdef HAVE_STRUCT_IO_URING_PARAMS_RESV
-static_assert(offsetof(struct_io_uring_params, resv)
-             >= offsetof(struct io_uring_params, resv),
-             "struct io_uring_params.resv offset mismatch"
-             ", please update the decoder");
-static_assert(sizeof_field(struct_io_uring_params, resv)
-             <= sizeof_field(struct io_uring_params, resv),
-             "struct io_uring_params.resv size mismatch"
-             ", please update the decoder");
-# else /* !HAVE_STRUCT_IO_URING_PARAMS_RESV */
-static_assert(0, "struct io_uring_params.resv is missing"
-		 ", please update the decoder");
-# endif
-#endif /* HAVE_STRUCT_IO_URING_PARAMS */
-
-
 SYS_FUNC(io_uring_setup)
 {
 	const uint32_t nentries = tcp->u_arg[0];
-- 
2.27.0



More information about the Strace-devel mailing list