[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <467C0CE9.5010502@austin.ibm.com>
Date: Fri, 22 Jun 2007 12:54:49 -0500
From: Joel Schopp <jschopp@...tin.ibm.com>
To: Dave Hansen <hansendc@...ibm.com>
CC: Andy Whitcroft <apw@...dowen.org>, Andrew Morton <akpm@...l.org>,
Randy Dunlap <rdunlap@...otime.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] update checkpatch.pl to version 0.06
> foo_ioctl()
> {
> switch(ioctl) {
> case FOO:
> lots
> of
> code
> error:
> return result;
> case BAR:
> return result;
> }
>
> Notice that the "error:" label is indented. Each of the case is kinda
> like a mini function with its own variables and return statement.
If it is "kinda like a mini function" why not make it "actually a mini function" and
call it?
I really don't like the indenting here. When I first glanced over that code I
thought "case FOO:", "case error:", "case BAR:". Only later after reading your
description did I realize error wasn't part of the switch, but an independent label.
>
> Do you think it is worth teaching the patch checker about these? It
> seems pretty sane style to me.
It hurts my eyes. Not that I'm the coding style czar or anything, if I were the
kernel coding style would be different in several ways. But inasmuch as this is a
democracy (which it isn't) then I am opposed to crazy indentation such as your example.
-
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