aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/scripting-engines/trace-event-python.c
diff options
context:
space:
mode:
authorAxel Lin <[email protected]>2014-08-05 10:08:31 +0800
committerGuenter Roeck <[email protected]>2014-08-05 17:48:52 -0700
commit5b963089161b8fb244889c972edf553b9d737545 (patch)
treed512add2afcc03879f3cb2581a2f5a32db6a0c93 /tools/perf/util/scripting-engines/trace-event-python.c
parentf4d33337eac4007793ca11fd1ab68d91ce7aa762 (diff)
hwmon: (lm92) Prevent overflow problem when writing large limits
On platforms with sizeof(int) < sizeof(long), writing a temperature limit larger than MAXINT will result in unpredictable limit values written to the chip. Avoid auto-conversion from long to int to fix the problem. The hysteresis temperature range depends on the value of data->temp[attr->index], since val is subtracted from it. Use a wider clamp, [-120000, 220000] should do to cover the possible range. Also add missing TEMP_TO_REG() on writes into cached hysteresis value. Also uses clamp_val to simplify the code a bit. Signed-off-by: Axel Lin <[email protected]> [Guenter Roeck: Fixed double TEMP_TO_REG on hysteresis updates] Cc: [email protected] Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions