[lkml]   [2019]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v3 08/11] platform/x86: asus-wmi: Enhance detection of thermal data
On 24.04.19 20:25, Pawnikar, Sumeet R wrote:
>> + /*
>> + * If the temperature value in deci-Kelvin is near the absolute
>> + * zero temperature, something is clearly wrong.
>> + */
>> + if (!value || value == 1)
>> + return 0;
> Do you still need to return 0 in case of wrong/failure case ?
> Shouldn't you return error here ?

Yes, I think 0 is right there, it's not an error condition in the check
itself (such as IO or memory error). The function returns two values: check
result in asus->asus_hwmon_thermal_available and error code.

This is still a successful negative result. The 0 or 1 (as added in this
patch) there merely indicates that the temperature measurement is not
available this way. It is safe to assume that no device that does provide
temperature will return 0.1 K. The temperature measurement is not critical
for driver operation so the driver proceeds without it.

One could return ENODEV when the check result is negative, but that would
just move the actual check and assignment further to asus_wmi_fan_init.

This is how it might look like in DSDT in this case:
Method (TMPR, 0, NotSerialized)
Return (One)
If ((IIA0 == 0x00110011))
Return ((TMPR () & 0xFFFF))

This is indeed the right method ID but it's nothing there.


 \ /
  Last update: 2019-04-25 20:52    [W:0.060 / U:4.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site