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

From: Andy Shevchenko

Date: Sat Oct 03 2026 - 15:20:51 EST


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