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

From: Andy Shevchenko

Date: Tue Sep 09 2025 - 09:15:27 EST


On Tue, Sep 09, 2025 at 11:53:02AM +0000, Sean Nyekjaer wrote:
> 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:

...

> > > /* 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?

With the same equality existing ones may be killed. Some of consistency at least :-)

> I will be happy to add them...

> > /* decrease FIFO on counter */
> >
> > > + st->fifo.on--;
> > > + return 0;
> > > }

--
With Best Regards,
Andy Shevchenko