[U-Boot] Policy for checkpatch usage?
Scott Wood
scottwood at freescale.com
Thu Apr 21 18:10:36 CEST 2011
On Thu, 21 Apr 2011 16:29:17 +0200
Detlev Zundel <dzu at denx.de> wrote:
> Hi Scott,
>
> > I vote for "checkpatch is a tool that can help you find some style problems,
> > but is imperfect, and the things it complains about are of varying
> > importance". If you insist on zero warnings, what's the difference between
> > a warning and an error? And will there then be a U-Boot-specific coding
> > style document to match? Will anyone that wants to submit a patch that
> > checkpatch erroneously complains about have to first submit a patch for
> > checkpatch (first learning Perl if need be)?
>
> So you would agree to this text:
>
> Checkpatch is a tool that can help you find some style problems, but is
> imperfect, and the things it complains about are of varying importance.
> So use common sense in interpreting the results. Warnings that clearly
> only make sense in the Linux kernel can be ignored.
Yes.
That said, if someone wants to maintain a U-Boot version, that'd be great.
> What about the problem with checkpatch errors in current code, i.e. the
> origin of this sentence:
>
> Also warnings produced for context lines (i.e. existing code) rather
> than actual changes can also be ignored.
>
> Do we want this?
That sounds like a bug in checkpatch, which should be reported.
But there's a similar issue of new code that is added in compliance with
the existing style in the file, which is slightly different from what
checkpatch wants. I'd usually be inclined to stick with what's already in
the file, as long as it's not too ugly, rather than introduce inconsistency
or reformat a large chunk of code to accommodate a small addition.
-Scott
More information about the U-Boot
mailing list