On Tue, Dec 17, 2024 at 3:40 AM Tudor Ambarus <tudor.ambarus@xxxxxxxxxx> wrote: .... > + > +static int exynos_mbox_chan_index(struct mbox_chan *chan) > +{ > + struct mbox_controller *mbox = chan->mbox; > + int i; > + > + for (i = 0; i < mbox->num_chans; i++) > + if (chan == &mbox->chans[i]) > + return i; > + return -EINVAL; > +} > Maybe simply return (chan - mbox->chans) ? Cheers!