Re: [PATCH v2 2/5] iio: light: tcs3472: convert remaining locking to guard(mutex)

From: Andy Shevchenko

Date: Wed May 13 2026 - 07:05:20 EST


On Wed, May 13, 2026 at 09:47:06AM +0200, Joshua Crofts wrote:
> On Wed, 13 May 2026 at 00:39, Aldo Conte <aldocontelk@xxxxxxxxx> wrote:

...

> > } scan = { };
> >
> > int ret = tcs3472_req_data(data);
> > +
>
> Unnecessary space here, function calls and return value checks should
> be grouped together.

Ah, good catch! We actually discourage the assignment and definition like this
(when the result is going to be validated). It's harder to maintain and prone to
subtle bugs.

Giving the above context, this should be rather as

} scan = { };
int ret;

ret = tcs3472_req_data(data);
if (ret ...)
...

--
With Best Regards,
Andy Shevchenko