summaryrefslogtreecommitdiff
path: root/tools/sanity_check
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-02-08 19:52:50 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-02-08 19:52:50 +0000
commitce9035388b804a854c02ac60cc9c5e33e35ab28c (patch)
treec34de778e7d672c9f160dd080a1488091755b616 /tools/sanity_check
parentcc074c66fabd3fb28f8387b64f58e6d49206f122 (diff)
fix bad comparison of possible frequency scaling governor values
git-svn-id: svn://localhost/ardour2/branches/3.0@8776 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'tools/sanity_check')
-rw-r--r--tools/sanity_check/systemtest.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/tools/sanity_check/systemtest.cpp b/tools/sanity_check/systemtest.cpp
index 0a8cae2d5f..c82167fa16 100644
--- a/tools/sanity_check/systemtest.cpp
+++ b/tools/sanity_check/systemtest.cpp
@@ -108,27 +108,27 @@ int system_uses_frequencyscaling() {
char filename[256], buf[256];
while (!done) {
- (void) snprintf(filename, 256, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", cpu);
- if (0<read_string(filename, buf, 256)) {
- if ((0!=strcmp("performance", buf)) &&
- (0!=strcmp("powersafe", buf))) {
- // So it's neither the "performance" nor the "powersafe" governor
- (void) snprintf(filename, 256, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_min_freq", cpu);
- if (read_int(filename, &min)) {
- (void) snprintf(filename, 256, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", cpu);
- if (read_int(filename, &max)) {
- if (min!=max) {
- // wrong governor AND different frequency limits -> scaling
- return 1;
- }
- }
- }
- }
- } else {
- // couldn't open file -> no more cores
- done = 1;
- }
- cpu++;
+ (void) snprintf(filename, 256, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor", cpu);
+ if (0<read_string(filename, buf, 256)) {
+ if ((0!=strncmp("performance", buf, 11)) &&
+ (0!=strncmp("powersafe", buf, 9))) {
+ // So it's neither the "performance" nor the "powersafe" governor
+ (void) snprintf(filename, 256, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_min_freq", cpu);
+ if (read_int(filename, &min)) {
+ (void) snprintf(filename, 256, "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_max_freq", cpu);
+ if (read_int(filename, &max)) {
+ if (min!=max) {
+ // wrong governor AND different frequency limits -> scaling
+ return 1;
+ }
+ }
+ }
+ }
+ } else {
+ // couldn't open file -> no more cores
+ done = 1;
+ }
+ cpu++;
}
// couldn't find anything that points to scaling