Re: [PATCH v2 2/4] iio: light: veml6030: fix channel type when pushing events
From: Andy Shevchenko
Date: Wed May 13 2026 - 16:03:09 EST
On Thu, May 14, 2026 at 07:13:41AM +1300, Javier Carrasco wrote:
> On Thu May 14, 2026 at 6:48 AM +13, Andy Shevchenko wrote:
> > On Wed, May 13, 2026 at 05:49:42PM +1300, Javier Carrasco wrote:
> >> The events are registered for IIO_LIGHT and not for IIO_INTENSITY.
> >> Use the correct channel type.
> >
> >> This bug was introduced in the first version of the driver.
> >
> > Unneeded detail, if it's a bug, use Fixes tag.
>
> >> When at it, fix minor checkpatch code style warning (alignment).
...
> >> - iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_INTENSITY,
> >> - 0, IIO_EV_TYPE_THRESH, evtdir),
> >> - iio_get_time_ns(indio_dev));
> >> + iio_push_event(indio_dev, IIO_UNMOD_EVENT_CODE(IIO_LIGHT,
> >> + 0,
> >> + IIO_EV_TYPE_THRESH,
> >> + evtdir),
> >> + iio_get_time_ns(indio_dev));
> >
> > AFAICS the indentation is still broken. Why not doing like this:
> >
> > iio_push_event(indio_dev,
> > IIO_UNMOD_EVENT_CODE(IIO_LIGHT, 0, IIO_EV_TYPE_THRESH, evtdir),
> > iio_get_time_ns(indio_dev));
>
> Thank you for your feedback. According to checkpatch.pl, both variants
> are fine. Mine takes into account the indentation within
> IIO_UNMOD_EVENT_CODE(),
And still have broken indentation with the last parameter. So it's not fine.
> and yours only accounts for the indentation for
> the arguments of iio_push_event(). Moreover, your suggestion goes beyond
> 80 characters and mine does not,
When it's about readability the 80 characters is not a strict limit.
> so I would prefer sticking to mine if
> possible.
I recommend to reconsider. Mine has no indentation issues, the only subtle
"problem" is 86 character line. And looking at the result I find mine better
to read (hence the exception may apply and we are fine with the length of
the line).
> As I said, it passes checkpatch --strict without warnings
> in both cases.
> I will send a new version adding the Fixes tag and removing the comment.
Make it the first patch as the currently first one does not sound like a fix
to me.
--
With Best Regards,
Andy Shevchenko