diff options
author | Palmer Cox <p@lmercox.com> | 2012-11-27 07:17:44 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-27 17:07:18 -0500 |
commit | fb8eaeb7ab96b09c910e36abf7df7f9ecbb0fb60 (patch) | |
tree | 4f25dc64aff0df779cb44d2718b98baeb5ebb070 /tools/power/cpupower | |
parent | 275a4dc441437d0074457591b46a45d7e45a817d (diff) |
cpupower tools: Fix minor warnings
Fix minor warnings reported with GCC 4.6:
* The sysfs_write_file function is unused - remove it.
* The pr_mon_len in the print_header function is unsed - remove it.
Signed-off-by: Palmer Cox <p@lmercox.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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) { |