From: Palmer Cox <p@lmercox.com>
To: Dominik Brodowski <linux@dominikbrodowski.net>,
Thomas Renninger <trenn@suse.de>
Cc: linux-kernel@vger.kernel.org, Palmer Cox <p@lmercox.com>
Subject: [PATCH 3/6] cpupower tools: Fix minor warnings
Date: Mon, 6 Aug 2012 22:24:45 -0400 [thread overview]
Message-ID: <1344306288-12369-4-git-send-email-p@lmercox.com> (raw)
In-Reply-To: <1344306288-12369-1-git-send-email-p@lmercox.com>
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.
---
tools/power/cpupower/utils/helpers/sysfs.c | 19 -------------------
.../cpupower/utils/idle_monitor/cpupower-monitor.c | 3 +--
2 files changed, 1 insertion(+), 21 deletions(-)
diff --git a/tools/power/cpupower/utils/helpers/sysfs.c b/tools/power/cpupower/utils/helpers/sysfs.c
index 96e28c1..38ab916 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)
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
*
diff --git a/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c b/tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c
index 0d6571e..7a657f3 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)
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) {
--
1.7.9.5
next prev parent reply other threads:[~2012-08-07 2:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-07 2:24 [PATCH 0/6] cpupower tools: Fix minor bugs and warnings Palmer Cox
2012-08-07 2:24 ` [PATCH 1/6] cpupower tools: Remove brace expansion from clean target Palmer Cox
2012-08-07 2:24 ` [PATCH 2/6] cpupower tools: Update .gitignore for files created in the debug directories Palmer Cox
2012-08-07 2:24 ` Palmer Cox [this message]
2012-08-07 2:24 ` [PATCH 4/6] cpupower tools: Fix issues with sysfs_topology_read_file Palmer Cox
2012-08-07 2:24 ` [PATCH 5/6] cpupower tools: Fix malloc of cpu_info structure Palmer Cox
2012-08-07 2:24 ` [PATCH 6/6] cpupower tools: Fix warning and a bug with the cpu package count Palmer Cox
2012-08-09 10:07 ` Thomas Renninger
2012-08-10 2:58 ` Palmer Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344306288-12369-4-git-send-email-p@lmercox.com \
--to=p@lmercox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=trenn@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®