A quick guide to why stand-alone checkpatch patches suck...

Greg Donald gdonald at gmail.com
Tue Sep 16 21:35:35 EDT 2014


On Tue, Sep 16, 2014 at 7:25 PM, Valdis Kletnieks
<Valdis.Kletnieks at vt.edu> wrote:
> In general, stand-alone patches to "fix" checkpatch whining are a Bad Idea(TM).

That's just YOUR opinion.  GregKH actually made a presentation to help
us n00bs do exactly that:

https://www.youtube.com/watch?v=LLBrBBImJt4

And he has been applying my cleanup patches for nearly a month now:

http://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/log/?h=staging-next&qt=author&q=gdonald

> First off, the type of programmer who is tempted to do checkpatch cleanup
> as "My First Kernel Patch" are, by and large, novices.

OMG, I'm a novice.. cat's out of the bag!  Your point?

> There's parts of the kernel that have been around for *years* and are beat on
> constantly - the VFS, the driver core code, large parts of the network stack
> for example.  Stand-alone checkpatch fixes here aren't a good idea, because
> they're potentially destabilizing if somebody gets the fix wrong. And yes, this
> has happened, and checkpatch "fixes" have actually introduced bugs - it's part
> of why there's a "one thing, one patch" rule, to make it easier to audit
> a patch and ensure it doesn't introduce regressions.  Oh, and most of this sort of
> code is already *really* clean, because professionals have cleaned it up.

fs/* currently contains 96,375 errors and 22,555 warnings.
net/* currently contains 3,366 errors and 19,536 warnings.

*really* clean?  LOL.

> So that leaves us code that's under active development.  And here, checkpatch
> fixes are actually a *detriment*, and they tick the subsystem maintainer off.
> That's because they have a high probability of causing merge conflicts with
> somebody else's patches that are doing *actual code improvement*.

So?  Either you suck it up and re-spin your patch or you go home and cry.

> The end result?  Unless you *are* that "somebody else" who's doing other
> work on the code, you shouldn't submit checkpatch cleanups.

I do Kernel janitor work for the *fun* of it.  I program in Python,
Java, and ObjC and manage a bunch of Linux servers at my day job.. so
changing up and doing Kernel cleanups in my spare time is *fun*.  I
may or may not ever actually become a full-fledged Kernel hacker and I
don't really care either way.

Meanwhile drivers/staging/* contains 19,004 errors and 35,292 warnings
and until the man stops taking my patches I'm going to continue
sending them.

As for you I'm just gonna ignore you and your discouraging posts from
here on.  It's not like you're in MAINTAINERS or anything.


-- 
Greg Donald



More information about the Kernelnewbies mailing list