Skip to content

Commit 5505182

Browse files
ubiedafabiobaltieri
authored andcommitted
rtio: Assert multishot flag is not combined with txn or chained
There's no use-case covering this case and enforcing it will allow simplify the logic for processing items with each of these items when mutually exclusive. Signed-off-by: Luis Ubieda <[email protected]>
1 parent 2aba39d commit 5505182

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

subsys/rtio/rtio_executor.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,12 @@ void rtio_executor_submit(struct rtio *r)
8484
#ifdef CONFIG_ASSERT
8585
bool transaction = iodev_sqe->sqe.flags & RTIO_SQE_TRANSACTION;
8686
bool chained = iodev_sqe->sqe.flags & RTIO_SQE_CHAINED;
87+
bool multishot = iodev_sqe->sqe.flags & RTIO_SQE_MULTISHOT;
8788

88-
__ASSERT(transaction != chained,
89-
"Expected chained or transaction flag, not both");
89+
__ASSERT((transaction ^ chained ^ multishot) &&
90+
!(transaction && chained && multishot),
91+
"Cannot have more than one of these flags"
92+
" enabled: transaction, chained or multishot");
9093
#endif
9194
node = mpsc_pop(&iodev_sqe->r->sq);
9295

0 commit comments

Comments
 (0)