[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <547B3E30.3030600@roeck-us.net>
Date: Sun, 30 Nov 2014 07:56:32 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Pali Rohár <pali.rohar@...il.com>
CC: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Steven Honeyman <stevenhoneyman@...il.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i8k: Fix temperature bug handling in i8k_get_temp()
On 11/30/2014 06:48 AM, Pali Rohár wrote:
[ ... ]
>>>
>>> + 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.
>
The idea was to return ENODATA to user space (see below).
>>> #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).
>
You mean when returning -ENODATA to user space ?
I tested that; it worked for me and does what we want it to do
(the sensors command to displays N/A). This would avoid having
to change -ERANGE to a different error code above.
Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists