The idea was to return ENODATA to user space (see below).
+ if (temp > I8K_MAX_TEMP)
+ return -ERANGE;
Can we return -ENODATA in this case ? I think that would be
more appropriate.
This is internal kernel function, no problem. If you prefer
NODATA instead RANGE I will change it.
#endif
return temp;
@@ -499,6 +501,8 @@ static ssize_t
i8k_hwmon_show_temp(struct device *dev,
int temp;
temp = i8k_get_temp(index);
+ if (temp == -ERANGE)
+ return -EINVAL;
and can we also return -ENODATA to user space ?
This would make the code a bit cleaner.
Thanks,
Guenter
There was some problems when I tested similar patch for radeon.ko
(do not report temperature to userspace when card is turned off).