[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d120d5000707240608l25e07de1we6f0b4d92ab6a4a3@mail.gmail.com>
Date: Tue, 24 Jul 2007 09:08:36 -0400
From: "Dmitry Torokhov" <dmitry.torokhov@...il.com>
To: "Andy Whitcroft" <apw@...dowen.org>
Cc: "Andrew Morton" <akpm@...ux-foundation.org>,
"Kok, Auke" <auke-jan.h.kok@...el.com>,
"Randy Dunlap" <rdunlap@...otime.net>,
"Joel Schopp" <jschopp@...tin.ibm.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] update checkpatch.pl to version 0.08
On 7/24/07, Andy Whitcroft <apw@...dowen.org> wrote:
> Andrew Morton wrote:
> > On Tue, 24 Jul 2007 10:06:51 +0100 Andy Whitcroft <apw@...dowen.org> wrote:
> >
> >>> This is a royal pain, since it now throws an ERROR for the obviously
> >>> preferable piece of code below:
> >>>
> >>> if (err) {
> >>> do_something();
> >>> return -ERR;
> >>> } else {
> >>> do_somthing_else();
> >>> }
> >> Hmmm, is that obviouly nicer than the below? Its fully a line longer
> >> for no benefit. But ignoring that, this seems to have snuck in to
> >> CodingStyle hmmm ... will see what I can do if anything to stop these
> >> being picked up I guess.
> >>
> >> if (err) {
> >> do_something();
> >> return -ERR;
> >> } else
> >> do_something_else();
> >
> > The kool kids on linux-usb-devel largely ended up deciding that the second
> > version looks dorky.
> >
> > Especially if there's a comment over do_something_else(), and if there's
> > not a comment, perhaps there should be?
> >
> >> Andrew, as you merged the change to CodingStyle I'll take that as your
> >> being ok with these being accepted.
> >
> > It's very marginal and is sure to get people hot and bothered. I'd suggest
> > that checkpatch be neutral on that.
>
> Ok, now if either the preceeding block or following block has {}'s then
> we don't report this block for being one line long. We will miss some
> this way, but hey.
>
It also complains on the following:
+ if (retval && !--handle->open) {
+ /*
+ * Make sure we are not delivering any more events
+ * through this handle
+ */
+ synchronize_sched();
+ }
There is no way I'll drop braces there. You should probably not
exclude comments from line count when making decision if braces are
needed.
--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists