Skip to content

Commit

Permalink
cpupower tools: Fix minor warnings
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Thomas Renninger <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
Palmer Cox authored and rafaeljw committed Nov 27, 2012
1 parent 275a4dc commit fb8eaeb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
19 changes: 0 additions & 19 deletions tools/power/cpupower/utils/helpers/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
3 changes: 1 addition & 2 deletions tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit fb8eaeb

Please sign in to comment.