From: Thomas Renninger <trenn@suse.de>
To: Elimar Riesebieter <riesebie@lxtec.de>
Cc: davej@codemonkey.org.uk, cpufreq@lists.linux.org.uk
Subject: [PATCH] Re: 2.6.22-rc2 built on ppc
Date: Mon, 21 May 2007 07:20:04 -0500 [thread overview]
Message-ID: <1179750004.20299.75.camel@sublime.suse.de> (raw)
In-Reply-To: <20070520111953.GH3253@aragorn.home.lxtec.de>
[-- Attachment #1: Type: text/plain, Size: 2005 bytes --]
On Sun, 2007-05-20 at 13:19 +0200, Elimar Riesebieter wrote:
> Hi,
>
> FYI, building the kernel with
> gcc (GCC) 4.1.3 20070514 (prerelease) (Debian 4.1.2-7)
> on my powerbook (PPC) gives:
> P
> ...
> drivers/cpufreq/cpufreq.c: In function 'cpufreq_add_dev':
> drivers/cpufreq/cpufreq.c:829: warning: ignoring return value of 'sysfs_create_file', declared with attribute warn_unused_result
> drivers/cpufreq/cpufreq.c:833: warning: ignoring return value of 'sysfs_create_file', declared with attribute warn_unused_result
> drivers/cpufreq/cpufreq.c:835: warning: ignoring return value of 'sysfs_create_file', declared with attribute warn_unused_result
> ...
This one should fix it:
Eliminate build warning (sysfs_create_file return value must be checked)
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
drivers/cpufreq/cpufreq.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Index: linux-2.6.22-rc2/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/cpufreq/cpufreq.c
+++ linux-2.6.22-rc2/drivers/cpufreq/cpufreq.c
@@ -826,13 +826,18 @@ static int cpufreq_add_dev (struct sys_d
/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
- sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
+ if (sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)))
+ goto err_out_driver_exit;
drv_attr++;
}
- if (cpufreq_driver->get)
- sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
- if (cpufreq_driver->target)
- sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
+ if (cpufreq_driver->get){
+ if (sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr))
+ goto err_out_driver_exit;
+ }
+ if (cpufreq_driver->target){
+ if (sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr))
+ goto err_out_driver_exit;
+ }
spin_lock_irqsave(&cpufreq_driver_lock, flags);
for_each_cpu_mask(j, policy->cpus) {
[-- Attachment #2: cpufreq_sysfs_create_file_warning.patch --]
[-- Type: text/x-patch, Size: 1320 bytes --]
Eliminate build warning (sysfs_create_file return value must be checked)
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
drivers/cpufreq/cpufreq.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
Index: linux-2.6.22-rc2/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-2.6.22-rc2.orig/drivers/cpufreq/cpufreq.c
+++ linux-2.6.22-rc2/drivers/cpufreq/cpufreq.c
@@ -826,13 +826,18 @@ static int cpufreq_add_dev (struct sys_d
/* set up files for this cpu device */
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
- sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
+ if (sysfs_create_file(&policy->kobj, &((*drv_attr)->attr)))
+ goto err_out_driver_exit;
drv_attr++;
}
- if (cpufreq_driver->get)
- sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
- if (cpufreq_driver->target)
- sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
+ if (cpufreq_driver->get){
+ if (sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr))
+ goto err_out_driver_exit;
+ }
+ if (cpufreq_driver->target){
+ if (sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr))
+ goto err_out_driver_exit;
+ }
spin_lock_irqsave(&cpufreq_driver_lock, flags);
for_each_cpu_mask(j, policy->cpus) {
[-- Attachment #3: Type: text/plain, Size: 147 bytes --]
_______________________________________________
Cpufreq mailing list
Cpufreq@lists.linux.org.uk
http://lists.linux.org.uk/mailman/listinfo/cpufreq
prev parent reply other threads:[~2007-05-21 12:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-20 11:19 2.6.22-rc2 built on ppc Elimar Riesebieter
2007-05-21 12:20 ` Thomas Renninger [this message]
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=1179750004.20299.75.camel@sublime.suse.de \
--to=trenn@suse.de \
--cc=cpufreq@lists.linux.org.uk \
--cc=davej@codemonkey.org.uk \
--cc=riesebie@lxtec.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