mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-25 20:28:21 +00:00
pwm: fix bad scaling due to use of integer type
This fixes commit c1a1f4ff20 ("pwm: Move
scaling factor from sensors prog to library") which didn't account for
return type of `get_type_scaling()` being `int` rather than `double` or
`float`, so the scaling was done by a factor of 2 instead of 2.55, thus
making the result off by quite a lot.
ms: adjust test
This commit is contained in:
1 parent
c297368a0e
commit
62a9553191
2 files changed
+3
-3
No files matched your search
+1
-1
@@ -139,7 +139,7 @@ static int sysfs_foreach_busdev(const char *bus_type,
|
||||
const char *sensors_sysfs_mount = "/sys";
|
||||
|
||||
static
|
||||
int get_type_scaling(sensors_subfeature_type type)
|
||||
double get_type_scaling(sensors_subfeature_type type)
|
||||
{
|
||||
/* Multipliers for second class subfeatures
|
||||
that need their own multiplier */
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
"crit": {
|
||||
"quantity": "temperature",
|
||||
"unit": "°C",
|
||||
"value": 93.85
|
||||
"value": 93.84999999999999
|
||||
},
|
||||
"input": {
|
||||
"quantity": "temperature",
|
||||
@@ -399,7 +399,7 @@
|
||||
"max": {
|
||||
"quantity": "temperature",
|
||||
"unit": "°C",
|
||||
"value": 89.85
|
||||
"value": 89.84999999999999
|
||||
},
|
||||
"min": {
|
||||
"quantity": "temperature",
|
||||
|
||||
Reference in new issue
Block a user