[lkml]   [2009]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 4/5] mm: add numa node symlink for cpu devices in sysfs
* David Rientjes <>:
> On Tue, 20 Oct 2009, Alex Chiang wrote:
> > * David Rientjes <>:
> > > The return values of register_cpu_under_node() and
> > > unregister_cpu_under_node() are always ignored, so it would probably be
> > > best to convert these to be void functions. That doesn't mean you can
> > > simply ignore the result of the first sysfs_create_link(), though: the
> > > second should probably be suppressed if the first returns an error.
> >
> > I didn't want to change too much in the patch. Changing the
> > function signature seems a bit overeager, but if you have strong
> > feelings, I can do so.
> It's entirely up to you if you want to change them to be void. I thought
> it would be cleaner if the first patch in the series would convert them to
> void on the basis that the return value is never actually used and then
> the following patches simply return on error conditions.

I made the conversion as you suggested, but discovered under
sparse that:

drivers/base/node.c: In function ‘register_cpu_under_node’:
drivers/base/node.c:245: warning: ignoring return value of
‘sysfs_create_link’, declared with attribute warn_unused_result

I wasn't very happy with the result after doing something with
the return value of sysfs_create_link to make sparse shutup.
Seemed unnatural and very much had the feeling of jumping through
hoops just to make an automated tool be quiet.

So, I'll just leave [un]register_cpu_under_node() as returning
int. It not only makes the patch feel better, but if we do ever
want to decide to unroll due to an error in sysfs_create_link,
we'll have the information available at the callsites.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2009-10-21 21:35    [W:0.037 / U:3.960 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site