diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 14:56:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-04-05 14:56:35 -0400 |
commit | 672a9c106966f8d418478830975288b8096bb058 (patch) | |
tree | e47259d8a96084affaab87b0104b56ac352dc0eb /tools | |
parent | e8403b493fd5180e351ca67eb66406d95dadcd0b (diff) | |
parent | 75a24b822d383489badd343cab4cb171d09f93ef (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina.
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial:
kfifo: fix inaccurate comment
tools/thermal: tmon: fix for segfault
net: Spelling s/stucture/structure/
edd: don't spam log if no EDD information is present
Documentation: Fix early-microcode.txt references after file rename
tracing: Block comments should align the * on each line
treewide: Fix typos in printk
GenWQE: Fix a typo in two comments
treewide: Align function definition open/close braces
Diffstat (limited to 'tools')
-rw-r--r-- | tools/thermal/tmon/sysfs.c | 12 | ||||
-rw-r--r-- | tools/thermal/tmon/tmon.c | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tools/thermal/tmon/sysfs.c b/tools/thermal/tmon/sysfs.c index 1c12536f2081..18f523557983 100644 --- a/tools/thermal/tmon/sysfs.c +++ b/tools/thermal/tmon/sysfs.c | |||
@@ -486,6 +486,7 @@ int zone_instance_to_index(int zone_inst) | |||
486 | int update_thermal_data() | 486 | int update_thermal_data() |
487 | { | 487 | { |
488 | int i; | 488 | int i; |
489 | int next_thermal_record = cur_thermal_record + 1; | ||
489 | char tz_name[256]; | 490 | char tz_name[256]; |
490 | static unsigned long samples; | 491 | static unsigned long samples; |
491 | 492 | ||
@@ -495,9 +496,9 @@ int update_thermal_data() | |||
495 | } | 496 | } |
496 | 497 | ||
497 | /* circular buffer for keeping historic data */ | 498 | /* circular buffer for keeping historic data */ |
498 | if (cur_thermal_record >= NR_THERMAL_RECORDS) | 499 | if (next_thermal_record >= NR_THERMAL_RECORDS) |
499 | cur_thermal_record = 0; | 500 | next_thermal_record = 0; |
500 | gettimeofday(&trec[cur_thermal_record].tv, NULL); | 501 | gettimeofday(&trec[next_thermal_record].tv, NULL); |
501 | if (tmon_log) { | 502 | if (tmon_log) { |
502 | fprintf(tmon_log, "%lu ", ++samples); | 503 | fprintf(tmon_log, "%lu ", ++samples); |
503 | fprintf(tmon_log, "%3.1f ", p_param.t_target); | 504 | fprintf(tmon_log, "%3.1f ", p_param.t_target); |
@@ -507,11 +508,12 @@ int update_thermal_data() | |||
507 | snprintf(tz_name, 256, "%s/%s%d", THERMAL_SYSFS, TZONE, | 508 | snprintf(tz_name, 256, "%s/%s%d", THERMAL_SYSFS, TZONE, |
508 | ptdata.tzi[i].instance); | 509 | ptdata.tzi[i].instance); |
509 | sysfs_get_ulong(tz_name, "temp", | 510 | sysfs_get_ulong(tz_name, "temp", |
510 | &trec[cur_thermal_record].temp[i]); | 511 | &trec[next_thermal_record].temp[i]); |
511 | if (tmon_log) | 512 | if (tmon_log) |
512 | fprintf(tmon_log, "%lu ", | 513 | fprintf(tmon_log, "%lu ", |
513 | trec[cur_thermal_record].temp[i]/1000); | 514 | trec[next_thermal_record].temp[i] / 1000); |
514 | } | 515 | } |
516 | cur_thermal_record = next_thermal_record; | ||
515 | for (i = 0; i < ptdata.nr_cooling_dev; i++) { | 517 | for (i = 0; i < ptdata.nr_cooling_dev; i++) { |
516 | char cdev_name[256]; | 518 | char cdev_name[256]; |
517 | unsigned long val; | 519 | unsigned long val; |
diff --git a/tools/thermal/tmon/tmon.c b/tools/thermal/tmon/tmon.c index 9aa19652e8e8..b43138f8b862 100644 --- a/tools/thermal/tmon/tmon.c +++ b/tools/thermal/tmon/tmon.c | |||
@@ -336,7 +336,6 @@ int main(int argc, char **argv) | |||
336 | show_data_w(); | 336 | show_data_w(); |
337 | show_cooling_device(); | 337 | show_cooling_device(); |
338 | } | 338 | } |
339 | cur_thermal_record++; | ||
340 | time_elapsed += ticktime; | 339 | time_elapsed += ticktime; |
341 | controller_handler(trec[0].temp[target_tz_index] / 1000, | 340 | controller_handler(trec[0].temp[target_tz_index] / 1000, |
342 | &yk); | 341 | &yk); |