Skip to content

Commit 9659281

Browse files
Srinivas-Kandagatlagregkh
authored andcommitted
slimbus: messaging: start transaction ids from 1 instead of zero
As tid is unsigned its hard to figure out if the tid is valid or invalid. So Start the transaction ids from 1 instead of zero so that we could differentiate between a valid tid and invalid tids This is useful in cases where controller would add a tid for controller specific transfers. Fixes: d3062a2 ("slimbus: messaging: add slim_alloc/free_txn_tid()") Cc: <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 36a21d5 commit 9659281

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/slimbus/messaging.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn)
6666
int ret = 0;
6767

6868
spin_lock_irqsave(&ctrl->txn_lock, flags);
69-
ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 0,
69+
ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 1,
7070
SLIM_MAX_TIDS, GFP_ATOMIC);
7171
if (ret < 0) {
7272
spin_unlock_irqrestore(&ctrl->txn_lock, flags);

0 commit comments

Comments
 (0)