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

Ingo Molnar
2007-10-05T05:57:05Z

here is an update wrt. the latest checkpatch.pl-next version
(v11-to-be), about kernel/sched.c warnings:

> size # warnings
> ----------------------------------------
> 25383 checkpatch.pl.v6 5
> 26038 checkpatch.pl.v7 6
> 29603 checkpatch.pl.v8 65
> 31160 checkpatch.pl.v9 24
> 34950 checkpatch.pl.v10 28

35948 checkpatch.pl.v11pre 11

so things are heading in the right direction :)

of those 11 warnings, 6 are correct warnings (4 will be solved via
KERN_CONT, 1 will be solved via a proper include file, and 1 is an
overlength line), 4 are borderline warnings (easily fixed) and only one
is a false positive! So v11-to-be gets the "best checkpatch.pl ever"
badge from me :)

The false positive is:

ERROR: need consistent spacing around '*' (ctx:WxV)
#5322:
+static ctl_table *sd_alloc_ctl_cpu_table(int cpu)
^

i think checkpatch.pl mistook this function definition as an arithmetic
expression?

But, there's a cleanliness bug underlying this false positive:
'ctl_table' is a typedef, and it would be cleaner to use 'struct
ctl_table' thoughout the kernel. When running checkpatch.pl over
include/linux/sysctl.h, it warns about the typedef:

WARNING: do not add new typedefs
#944:
+typedef struct ctl_table ctl_table;

(but mistaking that function for an arithmetic expression is still a bug
i think.)

nice work Andy!

Ingo