]> Pileus Git - ~andy/linux/commitdiff
cpupower tools: Fix minor warnings
authorPalmer Cox <p@lmercox.com>
Tue, 27 Nov 2012 12:17:44 +0000 (13:17 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 27 Nov 2012 22:07:18 +0000 (23:07 +0100)
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>
tools/power/cpupower/utils/helpers/sysfs.c
tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c

index 96e28c124b5ce25741038e52581249c4f020bf14..38ab91629463f31e2e81bad84f977a5421a03afe 100644 (file)
@@ -37,25 +37,6 @@ unsigned int sysfs_read_file(const char *path, char *buf, size_t buflen)
        return (unsigned int) numread;
 }
 
-static unsigned int sysfs_write_file(const char *path,
-                                    const char *value, size_t len)
-{
-       int fd;
-       ssize_t numwrite;
-
-       fd = open(path, O_WRONLY);
-       if (fd == -1)
-               return 0;
-
-       numwrite = write(fd, value, len);
-       if (numwrite < 1) {
-               close(fd);
-               return 0;
-       }
-       close(fd);
-       return (unsigned int) numwrite;
-}
-
 /*
  * Detect whether a CPU is online
  *
index 0d6571e418db4b7eb73017f23be7041c64bbe56c..7a657f3da23b73aa4b2ce07373d50efe5f7d1810 100644 (file)
@@ -84,7 +84,7 @@ int fill_string_with_spaces(char *s, int n)
 void print_header(int topology_depth)
 {
        int unsigned mon;
-       int state, need_len, pr_mon_len;
+       int state, need_len;
        cstate_t s;
        char buf[128] = "";
        int percent_width = 4;
@@ -93,7 +93,6 @@ void print_header(int topology_depth)
        printf("%s|", buf);
 
        for (mon = 0; mon < avail_monitors; mon++) {
-               pr_mon_len = 0;
                need_len = monitors[mon]->hw_states_num * (percent_width + 3)
                        - 1;
                if (mon != 0) {