From: Sergei Shtylyov <sshtylyov@ru•mvista.com>
To: Josh Boyer <jwboyer@linux•vnet.ibm.com>
Cc: Christian Krafft <krafft@de•ibm.com>,
"linuxppc-dev@ozlabs•org" <linuxppc-dev@ozlabs•org>
Subject: Re: [patch] powerpc: sysfs fix compiler warning
Date: Fri, 22 Jun 2007 23:09:12 +0400 [thread overview]
Message-ID: <467C1E58.6070702@ru.mvista.com> (raw)
In-Reply-To: <1182539095.1554.18.camel@weaponx.rchland.ibm.com>
Josh Boyer wrote:
> On Fri, 2007-06-22 at 22:57 +0400, Sergei Shtylyov wrote:
>
>>Hello.
>>
>>Josh Boyer wrote:
>>
>>
>>>>From: Christian Krafft <krafft@de•ibm.com>
>>
>>>>This patch fixes the following compiler warning:
>>>>arch/powerpc/kernel/sysfs.c:385: warning: ignoring return value of
>>>>`sysfs_create_group',
>>
>>>>Signed-off-by: Christian Krafft <krafft@de•ibm.com>
>>
>>>>Index: linux-2.6.22-rc5/arch/powerpc/kernel/sysfs.c
>>>>===================================================================
>>>>--- linux-2.6.22-rc5.orig/arch/powerpc/kernel/sysfs.c
>>>>+++ linux-2.6.22-rc5/arch/powerpc/kernel/sysfs.c
>>>>@@ -380,16 +380,23 @@ int cpu_add_sysdev_attr_group(struct att
>>>>{
>>>> int cpu;
>>>> struct sys_device *sysdev;
>>>>+ int error;
>>>>
>>>> mutex_lock(&cpu_mutex);
>>>>
>>>> for_each_possible_cpu(cpu) {
>>>> sysdev = get_cpu_sysdev(cpu);
>>>>- sysfs_create_group(&sysdev->kobj, attrs);
>>>>+ error |= sysfs_create_group(&sysdev->kobj, attrs);
>>>Why are you or'ing the return value with whatever is in the
>>>uninitialized variable?
>> To make it always fail, no doubt. ;-)
>> ISO accumulation error, it makes more sense to start cleanup created
>>groups right after the first creation failure -- although with the callers opf
>>this function ignoring the result anyway, who cares. :-)
> I care because he does an if (error) below that. Since error isn't
> initialized, it could be some random value and or'ing a 0 return code
> from sysfs_create_group would still trigger the error path.
> Plus, it's bogus anyway and should be fixed.
You misunderstood: I didn't at all object to fixing the bogosity you've
pointed out, just mused about how/if the error cleanup should be done.
> josh
WBR, Sergei
next prev parent reply other threads:[~2007-06-22 19:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-22 17:48 [patch] powerpc: sysfs fix compiler warning Christian Krafft
2007-06-22 18:38 ` Josh Boyer
2007-06-22 18:57 ` Sergei Shtylyov
2007-06-22 19:04 ` Josh Boyer
2007-06-22 19:09 ` Sergei Shtylyov [this message]
2007-06-22 19:12 ` Josh Boyer
2007-06-23 9:46 ` Michael Buesch
2007-06-25 17:07 ` Christian Krafft
-- strict thread matches above, loose matches on Subject: below --
2007-06-29 14:50 Christian Krafft
2007-06-29 14:57 ` Michael Buesch
2007-06-29 16:10 ` Christian Krafft
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=467C1E58.6070702@ru.mvista.com \
--to=sshtylyov@ru$(echo .)mvista.com \
--cc=jwboyer@linux$(echo .)vnet.ibm.com \
--cc=krafft@de$(echo .)ibm.com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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