From b303a7f621c546a2fd419c57e2d67c1425b27e56 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Tue, 23 Aug 2022 14:12:49 +0200 Subject: [PATCH] _set_sqe_cmd_op: Simplify the code - direct variable access Members of the union can be accessed directly using the other union member off is not needed here. --- include/ublksrv_priv.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/ublksrv_priv.h b/include/ublksrv_priv.h index 7e5987d9..1d24f4c8 100644 --- a/include/ublksrv_priv.h +++ b/include/ublksrv_priv.h @@ -81,10 +81,8 @@ static inline void *ublksrv_get_sqe_cmd(struct io_uring_sqe *sqe) static inline void ublksrv_set_sqe_cmd_op(struct io_uring_sqe *sqe, __u32 cmd_op) { - __u32 *addr = (__u32 *)&sqe->off; - - addr[0] = cmd_op; - addr[1] = 0; + sqe->cmd_op = cmd_op; + sqe->__pad1 = 0; } #ifdef DEBUG