From 496cec843e13e214d75f16cb8a426929b7377bb8 Mon Sep 17 00:00:00 2001 From: Ilya Zlobintsev Date: Tue, 2 Mar 2021 16:20:48 +0200 Subject: [PATCH] Remove unused GetPowerCap method --- daemon/src/daemon_connection.rs | 7 ------- daemon/src/lib.rs | 8 -------- 2 files changed, 15 deletions(-) diff --git a/daemon/src/daemon_connection.rs b/daemon/src/daemon_connection.rs index 3a4ad6c..9aef5ce 100644 --- a/daemon/src/daemon_connection.rs +++ b/daemon/src/daemon_connection.rs @@ -94,13 +94,6 @@ impl DaemonConnection { } } - pub fn get_power_cap(&self, gpu_id: u32) -> Result<(i64, i64), DaemonError> { - match self.send_action(Action::GetPowerCap(gpu_id))? { - DaemonResponse::PowerCap(cap) => Ok(cap), - _ => unreachable!(), - } - } - pub fn set_power_cap(&self, gpu_id: u32, cap: i64) -> Result<(), DaemonError> { match self.send_action(Action::SetPowerCap(gpu_id, cap))? { DaemonResponse::OK => Ok(()), diff --git a/daemon/src/lib.rs b/daemon/src/lib.rs index a6bcb74..d84f0f6 100644 --- a/daemon/src/lib.rs +++ b/daemon/src/lib.rs @@ -42,7 +42,6 @@ pub enum Action { GetFanControl(u32), SetFanCurve(u32, BTreeMap), SetPowerCap(u32, i64), - GetPowerCap(u32), SetPowerProfile(u32, PowerProfile), // SetGPUPowerState(u32, u32, i64, Option), SetGPUMaxPowerState(u32, i64, Option), @@ -304,13 +303,6 @@ impl Daemon { }, None => Err(DaemonError::InvalidID), }, - Action::GetPowerCap(i) => match self.gpu_controllers.get(&i) { - Some(controller) => match controller.get_power_cap() { - Ok(cap) => Ok(DaemonResponse::PowerCap(cap)), - Err(_) => Err(DaemonError::HWMonError), - }, - None => Err(DaemonError::InvalidID), - }, Action::SetPowerProfile(i, profile) => match self.gpu_controllers.get_mut(&i) { Some(controller) => match controller.set_power_profile(profile) { Ok(_) => {