Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl
From: Valdis . Kletnieks
Date: Wed Jan 09 2008 - 03:24:19 EST
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:
pgp00000.pgp
Description: PGP signature