Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 09 Jan 2008 08:06:20 GMT, Christoph Hellwig said:

> It's generally considered good style to only have as few as possible
> return values.  And this is especially important when returning from
> a section that's under a lock.  So in this case it would be much better
> if you changes this function to have a local 'int error' variable
> and then just do
> 
> 	error = -EFOO;
> 	goto out_unlock;

I think Christoph meant to say "as few as possible return locations".  One
should write the code to have as many different return values as are
meaningful, but return them from as few places as possible - which is what the
"assign error and goto end" paradigm does...

Attachment: pgp0i7VpsbUk0.pgp
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux