linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Christian Krafft <krafft@de.ibm.com>
To: Michael Buesch <mb@bu3sch.de>
Cc: "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>
Subject: Re: [patch] powerpc: sysfs fix compiler warning
Date: Fri, 29 Jun 2007 18:10:13 +0200	[thread overview]
Message-ID: <20070629181013.61d13b54@localhost> (raw)
In-Reply-To: <200706291657.20942.mb@bu3sch.de>

[-- Attachment #1: Type: text/plain, Size: 1880 bytes --]

On Fri, 29 Jun 2007 16:57:20 +0200
Michael Buesch <mb@bu3sch.de> wrote:

> On Friday 29 June 2007 16:50:10 Christian Krafft 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>
> > 
> > --- linux-2.6.orig/arch/powerpc/kernel/sysfs.c
> > +++ linux-2.6/arch/powerpc/kernel/sysfs.c
> > @@ -380,16 +380,25 @@ int cpu_add_sysdev_attr_group(struct att
> >  {
> >  	int cpu;
> >  	struct sys_device *sysdev;
> > +	int error = 0;
> >  
> >  	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);
> > +
> > +		if (error) {
> > +			for_each_possible_cpu(cpu) {
> > +				sysdev = get_cpu_sysdev(cpu);
> > +				sysfs_remove_group(&sysdev->kobj, attrs);
> 
> Is sysfs_remove_group() safe to call on kobjs for which
> we did not call sysfs_create_group()?

I only looked into it a little and haven't seen a problem.
From the interface point of view I would say it would be a bug, if it's not safe.
But I will do a short test on this.


> 
> > +			}
> > +			break;
> > +		}
> >  	}
> >  
> >  	mutex_unlock(&cpu_mutex);
> > -	return 0;
> > +	return error;
> >  }
> >  EXPORT_SYMBOL_GPL(cpu_add_sysdev_attr_group);
> >  
> > 
> > 
> 
> 
> 


-- 
Mit freundlichen Gruessen,
kind regards,

Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist


Vorsitzender des Aufsichtsrats:	Martin Jetter
Geschaeftsfuehrung:		Herbert Kircher
Sitz der Gesellschaft:		Boeblingen
Registriergericht:		Amtsgericht Stuttgart, HRB 243294


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-06-29 16:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-29 14:50 [patch] powerpc: sysfs fix compiler warning Christian Krafft
2007-06-29 14:57 ` Michael Buesch
2007-06-29 16:10   ` Christian Krafft [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-06-22 17:48 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
2007-06-22 19:12         ` Josh Boyer
2007-06-23  9:46 ` Michael Buesch
2007-06-25 17:07   ` 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=20070629181013.61d13b54@localhost \
    --to=krafft@de.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mb@bu3sch.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;
as well as URLs for NNTP newsgroup(s).