Re: [PATCH v2] iio: temperature: ltc2983: pass leak detector type explicitly

From: Carlos Casadiego

Date: Sat Oct 03 2026 - 17:42:25 EST


Thanks for the review.

Noted on ABSOLUTE_ZERO_MILLICELSIUS for a follow-up change.

Cc'ing Arnd as his patch overlaps with this one. I'll wait for the maintainers' preference on the two approaches.

Thanks,
Carlos

En Sat, Oct 03, 2026 at 10:20:41PM +0300, Andy Shevchenko escribió:
> On Fri, Oct 02, 2026 at 11:44:50AM -0500, Carlos Casadiego via B4 Relay wrote:
>
> > __ltc2983_custom_sensor_new() uses propname both to select the firmware
> > property to read and to determine whether the custom sensor is a leak
> > detector.
> >
> > Pass this information explicitly from the caller instead of deriving
> > the sensor type from the firmware property name. This keeps propname
> > limited to identifying the property and preserves the existing
> > conversion behavior.
> >
> > As a side effect, this also avoids the -Wstring-compare warning reported
> > by the kernel test robot for callers where GCC can determine that the
> > property name cannot match "adi,custom-leak-detector".
>
> Reviewed-by: Andy Shevchenko <andy@xxxxxxxxxx>
>
> ...
>
> > - if ((index % 2) != 0 && !strcmp(propname, "adi,custom-leak-detector"))
> > + if ((index % 2) != 0 && is_leak_detector)
> > temp = temp * 1000000 + 273150000;
>
> A side note for the further changes: We have ABSOLUTE_ZERO_MILLICELSIUS
> that can be used here.
>
> ...
>
> Since Arnd also submitted similar fix, it would be good to Cc him. And in
> general, if there is a clash with the patches addressing same issue, Cc all
> other authors.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>