Re: [PATCH v4 5/5] iio: imu: inv_icm42600: use guard() to release mutexes

From: Sean Nyekjaer
Date: Tue Sep 09 2025 - 07:53:27 EST


On Tue, Sep 09, 2025 at 02:39:12PM +0100, Andy Shevchenko wrote:
> On Tue, Sep 09, 2025 at 09:11:11AM +0200, Sean Nyekjaer wrote:
> > Replace explicit mutex_lock() and mutex_unlock() with the guard() macro
> > for cleaner and safer mutex handling.
>
> ...
>
> > /* exit if FIFO is already on */
> > if (st->fifo.on) {
> > - ret = 0;
> > - goto out_on;
>
> Probably you wanted the same comment here
>
> /* increase FIFO on counter */
>
> > + st->fifo.on++;
> > + return 0;
> > }
>
> ...
>
> > /* exit if there are several sensors using the FIFO */
> > if (st->fifo.on > 1) {
> > - ret = 0;
> > - goto out_off;
>
> In the similar way
>

Considered it. But isn't it obvious whats happening?
I will be happy to add them...

/Sean

> /* decrease FIFO on counter */
>
> > + st->fifo.on--;
> > + return 0;
> > }
>
> --
> With Best Regards,
> Andy Shevchenko
>
>