Re: [PATCH 1/1] checkpatch.pl: thou shalt not use () or (...) infunction declarations

From: Joe Perches
Date: Thu Mar 22 2012 - 12:33:41 EST


On Thu, 2012-03-22 at 16:49 +0100, richard -rw- weinberger wrote:
> On Thu, Mar 22, 2012 at 4:27 PM, Phil Carmody
> <ext-phil.2.carmody@xxxxxxxxx> wrote:
> > After HPA's wonderful lkml post, referenced, it seems worth trying to
> > detect this robomatically.
>
> See:
> http://marc.info/?l=linux-kernel&m=133193918813599

But Phil's test is better because it also
tests for function declarations on multiple
lines like

type
foo(...)

if ($ctx =~ /((\b$Type\s+$Ident)\s*\(\s*(?:\.\.\.)?\s*\))/) {

The ERROR needs updating for a --ignore type though.
Something like this may be better.

ERROR("FUNCTION_NO_PROTOTYPE",
"Bad function definition - $1 should probably be $2(void)\n" .
herecurr);

And I think the screed funny once but not useful.


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