From be4c3804de3ba86e1e5eaed4ab196cfa4ed8f580 Mon Sep 17 00:00:00 2001 From: Tom Burdick Date: Thu, 10 Jul 2025 16:56:06 -0500 Subject: [PATCH] rtio: Fix syscall verify misra-c:2004 12.4 issue MISRA-C says the right hand of a logical and should not contain side effect operations. Instead nest the branches to get the same logic without the MISRA-C rule breakage. Signed-off-by: Tom Burdick --- subsys/rtio/rtio_handlers.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subsys/rtio/rtio_handlers.c b/subsys/rtio/rtio_handlers.c index a82de1635f9..beb2a545c52 100644 --- a/subsys/rtio/rtio_handlers.c +++ b/subsys/rtio/rtio_handlers.c @@ -19,8 +19,10 @@ */ static inline bool rtio_vrfy_sqe(struct rtio_sqe *sqe) { - if (sqe->iodev != NULL && K_SYSCALL_OBJ(sqe->iodev, K_OBJ_RTIO_IODEV)) { - return false; + if (sqe->iodev != NULL) { + if (K_SYSCALL_OBJ(sqe->iodev, K_OBJ_RTIO_IODEV)) { + return false; + } } bool valid_sqe = true;