Re: [git pull] PCI pull request for 2.6.27

From: Linus Torvalds
Date: Wed Jul 16 2008 - 20:38:32 EST




On Thu, 17 Jul 2008, Maciej W. Rozycki wrote:
>
> Conveniently "for" is short enough for indentation like this:
>
> for (addr = (u8 *) __va(0xf0000);
> addr < (u8 *) __va(0x100000);
> addr += 16) {
> rt = pirq_check_routing_table(addr);

I don't actually like that one very much either.

It's perfectly readable when looking at things closely, but it's not very
nice when quickly "scanning" code visually. It looks like two separate
indents.

Btw, that "code scanning" is not necessarily a bad idea. It's actually
pretty interesting to print code out in a 2-point font (or just open a
terminal and do "ctrl -" several times to make the code basically
unreadable). See if the code flow makes sense from 10,000 feet - you can
pick up overlong functions and various other dubious practices really
clearly (#ifdef's in code etc).

(IOW, the whole point of the exercise is to _not_ be able to actually read
the code, but just look at the _shape_ of it).

Btw, that commit also did things like change the coding style to a
non-kernel coding style by changing

static int function(xyz..)

to

static int
function(xyz..)

just to make lines shorter. Again - introducing bigger problems than it
actually fixes.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/