diff options
Diffstat (limited to 'tools/power/cpupower')
-rw-r--r-- | tools/power/cpupower/utils/helpers/sysfs.c | 19 | ||||
-rw-r--r-- | tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | 3 |
2 files changed, 1 insertions, 21 deletions
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c index 96e28c124b5c..38ab91629463 100644 --- a/tools/power/cpupower/utils/helpers/sysfs.c +++ b/tools/power/cpupower/utils/helpers/sysfs.c | |||
@@ -37,25 +37,6 @@ unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen) | |||
37 | return (unsigned int) numread; | 37 | return (unsigned int) numread; |
38 | } | 38 | } |
39 | 39 | ||
40 | static unsigned int sysfs_write_file(const char *path, | ||
41 | const char *value, size_t len) | ||
42 | { | ||
43 | int fd; | ||
44 | ssize_t numwrite; | ||
45 | |||
46 | fd = open(path, O_WRONLY); | ||
47 | if (fd == -1) | ||
48 | return 0; | ||
49 | |||
50 | numwrite = write(fd, value, len); | ||
51 | if (numwrite < 1) { | ||
52 | close(fd); | ||
53 | return 0; | ||
54 | } | ||
55 | close(fd); | ||
56 | return (unsigned int) numwrite; | ||
57 | } | ||
58 | |||
59 | /* | 40 | /* |
60 | * Detect whether a CPU is online | 41 | * Detect whether a CPU is online |
61 | * | 42 | * |
diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c index 0d6571e418db..7a657f3da23b 100644 --- a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c +++ b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | |||
@@ -84,7 +84,7 @@ int fill_string_with_spaces(char *s, int n) | |||
84 | void print_header(int topology_depth) | 84 | void print_header(int topology_depth) |
85 | { | 85 | { |
86 | int unsigned mon; | 86 | int unsigned mon; |
87 | int state, need_len, pr_mon_len; | 87 | int state, need_len; |
88 | cstate_t s; | 88 | cstate_t s; |
89 | char buf[128] = ""; | 89 | char buf[128] = ""; |
90 | int percent_width = 4; | 90 | int percent_width = 4; |
@@ -93,7 +93,6 @@ void print_header(int topology_depth) | |||
93 | printf("%s|", buf); | 93 | printf("%s|", buf); |
94 | 94 | ||
95 | for (mon = 0; mon < avail_monitors; mon++) { | 95 | for (mon = 0; mon < avail_monitors; mon++) { |
96 | pr_mon_len = 0; | ||
97 | need_len = monitors[mon]->hw_states_num * (percent_width + 3) | 96 | need_len = monitors[mon]->hw_states_num * (percent_width + 3) |
98 | - 1; | 97 | - 1; |
99 | if (mon != 0) { | 98 | if (mon != 0) { |