Skip to content

Commit fb9cd40

Browse files
committed
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 <thomas.burdick@intel.com>
1 parent c85b3ae commit fb9cd40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

subsys/rtio/rtio_syscalls.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
*/
2020
static inline bool rtio_vrfy_sqe(struct rtio_sqe *sqe)
2121
{
22-
if (sqe->iodev != NULL && K_SYSCALL_OBJ(sqe->iodev, K_OBJ_RTIO_IODEV)) {
23-
return false;
22+
if (sqe->iodev != NULL) {
23+
if (K_SYSCALL_OBJ(sqe->iodev, K_OBJ_RTIO_IODEV)) {
24+
return false;
25+
}
2426
}
2527

2628
bool valid_sqe = true;

0 commit comments

Comments
 (0)