Re: [PATCH] update checkpatch.pl to version 0.06

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

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux