Skip to content

Commit

Permalink
refactor: 移除部分错误处理日志
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow3aaa committed Nov 27, 2024
1 parent 757b63c commit ed5e0fd
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/cpu_common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use anyhow::Result;
use cpu_info::Info;
#[cfg(debug_assertions)]
use log::debug;
use log::{error, warn};
use log::warn;

use crate::{
api::{trigger_init_cpu_freq, trigger_reset_cpu_freq},
Expand Down Expand Up @@ -154,25 +154,19 @@ impl Controller {
.clamp(0, self.max_freq);
#[cfg(debug_assertions)]
debug!("policy{} freq: {}", cpu.policy, policy_freq);
if let Err(e) = cpu.write_freq(policy_freq, &mut self.file_handler) {
error!("{:?}", e);
}
let _ = cpu.write_freq(policy_freq, &mut self.file_handler);
}
}

fn set_all_cpu_freq(&mut self, freq: isize) {
for cpu in &mut self.cpu_infos {
if let Err(e) = cpu.write_freq(freq, &mut self.file_handler) {
error!("{:?}", e);
}
let _ = cpu.write_freq(freq, &mut self.file_handler);
}
}

fn reset_all_cpu_freq(&mut self) {
for cpu in &self.cpu_infos {
if let Err(e) = cpu.reset_freq(&mut self.file_handler) {
error!("{:?}", e);
}
let _ = cpu.reset_freq(&mut self.file_handler);
}
}

Expand Down

0 comments on commit ed5e0fd

Please sign in to comment.