[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <23897.1199867034@turing-police.cc.vt.edu>
Date: Wed, 09 Jan 2008 03:23:54 -0500
From: Valdis.Kletnieks@...edu
To: Christoph Hellwig <hch@...radead.org>
Cc: Nikanth Karthikesan <knikanth@...e.de>, grant@...que.net,
tim@...erelk.net, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] Change paride driver to use unlocked_ioctl instead of ioctl
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...
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists