From: Srinivas Kandagatla Date: Mon, 9 Aug 2021 08:24:25 +0000 (+0100) Subject: slimbus: messaging: start transaction ids from 1 instead of zero X-Git-Tag: accepted/tizen/unified/20230118.172025~6625^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9659281ce78de0f15a4aa124da8f7450b1399c09;p=platform%2Fkernel%2Flinux-rpi.git 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: d3062a210930 ("slimbus: messaging: add slim_alloc/free_txn_tid()") Cc: Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210809082428.11236-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c index f2b5d34..6097ddc4 100644 --- a/drivers/slimbus/messaging.c +++ b/drivers/slimbus/messaging.c @@ -66,7 +66,7 @@ int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) int ret = 0; spin_lock_irqsave(&ctrl->txn_lock, flags); - ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 0, + ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 1, SLIM_MAX_TIDS, GFP_ATOMIC); if (ret < 0) { spin_unlock_irqrestore(&ctrl->txn_lock, flags);