Re: checkpatch.pl is getting too slow

From: Daniel Walker
Date: Sun Feb 01 2009 - 09:33:39 EST


On Sat, 2009-01-31 at 20:46 -0800, Greg KH wrote:

> But defines do cross a line, and we should be able to check them
> properly, isn't that what the original version of this was doing?

The current version isn't able to detect the end of a define, single
line or multi-line .. I think it only see's a semi-colon as a block
ending, or "}".

so if you had,

#define block_one (1)
#define block_two (2)
... [100 more single line defines] ...
int i = block_one + block_two;

The processing starts at "block_one" and that block ends at "int i =
block_one + block_two;" , since that's the only line with a semi-colon.
Then the processing moves to the next line "block_two" and that block
also ends at "int i = block_one + block_two;" , and that happens 100
times for each define moving down.

However, each define should really be seen as a block of only one line,
or when there's a multi-line define that should all be one block.

Daniel



--
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/