On Tue, 24 May 2005, Pekka Enberg wrote:
> > +static int
> > +v9fs_vfs_create(struct inode *inode, struct dentry *dentry, int perm,
> > + struct nameidata *nd)
> > +{
> > + int retval = -EPERM;
> > + int open_mode = O_RDWR;
> > +
> > + retval = v9fs_create(inode, dentry, perm, open_mode);
> > +
> > + return retval;
>
> Both local variables are redundant. Please just do:
>
> return v9fs_create(inode, dentry, perm, O_RDWR);
>
well, here is my first point of disagreement with the many good
suggestions I have seen.
I prefer the style as it is, and dislike the return vfs_create(...)
change.
First, we're all agreed here that this is a style, not efficiency thing,
right? Makes no difference, compiler will do what is right.
The reason I prefer the 'retval = blah blah; return retval;' usage is that
I frequently have run v9fs in UML, and debugging is just easier. Set the
breakpoint in v9fs_vfs_create, step through, maybe skip over that
v9fs_create function, look at retval. Also, should we get to the point
later that we have a debug print of some sort in that function, adding it
is trivial.
I realize there is a preferred style here, but is there room for some
flexibility?
thanks
ron
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]