Re: [PATCH] checkpatch: Warn on code with 6+ tab indentation

From: Linus Torvalds
Date: Fri Feb 03 2012 - 22:36:37 EST

On Fri, Feb 3, 2012 at 7:21 PM, Joe Perches <joe@xxxxxxxxxxx> wrote:
> I think that's a bad test.
> It finds a _lot_ of line continuations.
> The right test is _only_ for 6 or more tabs
> followed by (if|for|while|do|else|switch)

Fair enough.

And I have to admit that doing your grep with an additional -4 to see
some context does make a fairly strong argument for your patch.

The code in drivers/isdn/hisax/hfc_usb.c that triggers is absolutely
disgusting, and does crazy things due to the long lines.

As is some other code that grep shows.

In fact, I think that grep convinced me that you are right about this
particular pattern. Brr. Now I need to go dig my eyes out with a


> $ grep -rP --include=*.[ch] "^\t{6,}(if|for|while|do|else|switch)" * | \
>  wc -l
> 1509
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at