1
From 41bee2100a9b7905f82022aa2ff0b72aeadd1116 Mon Sep 17 00:00:00 2001
2
From: Colin Ian King <colin.king@canonical.com>
3
Date: Mon, 10 Mar 2014 10:23:49 +0000
4
Subject: [PATCH 20/28] cthd_engine: remove redundant reads of thermal zone
7
takeover_thermal_control() and giveup_thermal_control() both
8
contain redundant reads of the thermal zone type fields, so remove
11
Signed-off-by: Colin Ian King <colin.king@canonical.com>
13
src/thd_engine.cpp | 12 ------------
14
1 file changed, 12 deletions(-)
16
diff --git a/src/thd_engine.cpp b/src/thd_engine.cpp
17
index 565b3d4..c8beed4 100644
18
--- a/src/thd_engine.cpp
19
+++ b/src/thd_engine.cpp
20
@@ -444,14 +444,8 @@ void cthd_engine::takeover_thermal_control() {
22
i = atoi(entry->d_name + strlen("thermal_zone"));
23
std::stringstream policy;
24
- std::stringstream type;
25
- std::string type_val;
26
std::string curr_policy;
28
- type << "thermal_zone" << i << "/type";
29
- if (sysfs.exists(type.str().c_str())) {
30
- sysfs.read(type.str(), type_val);
32
policy << "thermal_zone" << i << "/policy";
33
if (sysfs.exists(policy.str().c_str())) {
34
sysfs.read(policy.str(), curr_policy);
35
@@ -487,13 +481,7 @@ void cthd_engine::giveup_thermal_control() {
37
i = atoi(entry->d_name + strlen("thermal_zone"));
38
std::stringstream policy;
39
- std::stringstream type;
40
- std::string type_val;
42
- type << "thermal_zone" << i << "/type";
43
- if (sysfs.exists(type.str().c_str())) {
44
- sysfs.read(type.str(), type_val);
46
policy << "thermal_zone" << i << "/policy";
47
if (sysfs.exists(policy.str().c_str())) {
48
sysfs.write(policy.str(), zone_preferences[cnt++]);