mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-10-26 12:24:33 +00:00
Completely correct limit handling for the lm78 module
Whatever you cat to /proc/..../lm78-*/*, the result will now always be sensible. No more overflows resulting in weird values. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@381 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
e3bfcd92c1
commit
3e38c3f87e
2 files changed
+26
-14
No files matched your search
@@ -280,6 +280,19 @@ extern int sensors_detect(struct i2c_adapter *adapter,
|
||||
struct sensors_address_data *address_data,
|
||||
sensors_found_addr_proc *found_proc);
|
||||
|
||||
|
||||
/* This macro is used to scale user-input to sensible values in almost all
|
||||
chip drivers. */
|
||||
extern inline int SENSORS_LIMIT(long value, long low, long high)
|
||||
{
|
||||
if (value < low)
|
||||
return low;
|
||||
else if (value > high)
|
||||
return high;
|
||||
else
|
||||
return value;
|
||||
}
|
||||
|
||||
#endif /* def __KERNEL__ */
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user