lkml.org 
[lkml]   [2006]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: bus_add_device() losing an error return from the probe() method
Andrew Morton wrote:

> Looks sane, but please don't sprinkle `return' statements all over a
> function in this manner.

I actually prefer the multiple returns. You then don't have to "visually
scroll down" to the label to see what would happen when reading the
code. Even when there's common code before the return, I've never seen
GCC not optimise that to the goto form itself. You obviously the boss
though.

> It's a little surprising that this function returns "OK" if bus==NULL.
>
> Note that sysfs_create_link() can fail too. This was one optimistic
> function.

I assume that Greg hasn't commented yet since he's busy rewriting it
all, so that'll be okay :-)

Rene.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-03-27 00:33    [from the cache]
©2003-2011 Jasper Spaans