aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cputemp2maxfreq.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/cputemp2maxfreq.c b/cputemp2maxfreq.c
index 7098ccc..81fcdef 100644
--- a/cputemp2maxfreq.c
+++ b/cputemp2maxfreq.c
@@ -290,6 +290,13 @@ int main(int argc,char **argv)
failsafe(1);
}
+ cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq");
+ if ((cpudata.scale_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX))
+ {
+ config.logger("Invalid scale_max_freq reported, exiting");
+ failsafe(1);
+ }
+
DEBUG1_MAIN("Data: %ld %ld %ld %ld %ld\n",cpudata.cur_temp,config.max_temp,cpudata.max_freq,cpudata.scale_max,cpudata.cur_freq);
if (config.log_data>0)
{
@@ -313,12 +320,6 @@ int main(int argc,char **argv)
config.logger("Failed to set scaling_max_freq, exiting");
failsafe(1);
}
- cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq");
- if ((cpudata.scale_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX))
- {
- config.logger("Invalid scale_max_freq reported, exiting");
- failsafe(1);
- }
}
// Check if we should decrease
@@ -335,12 +336,6 @@ int main(int argc,char **argv)
config.logger("Failed to set scaling_max_freq, exiting");
failsafe(1);
}
- cpudata.scale_max=cpufreq_get_long_int("scaling_max_freq");
- if ((cpudata.scale_max<VALID_FREQ_MIN) || (cpudata.scale_max>VALID_FREQ_MAX))
- {
- config.logger("Invalid scale_max_freq reported, exiting");
- failsafe(1);
- }
}
sleep(config.interval);