Re: [PATCH v4 2/2] docs: add documentation for checkpatch

From: Joe Perches
Date: Fri Feb 19 2021 - 12:56:45 EST


On Wed, 2021-02-17 at 22:24 +0530, Dwaipayan Ray wrote:
> Add documentation for kernel script checkpatch.pl.
> This documentation is also parsed by checkpatch to
> enable a verbose mode.
>
> The checkpatch message types are grouped by usage. Under
> each group the types are described briefly. 34 of such
> types are documented.

Of course with more to come as you are work on them... ;)

> diff --git a/Documentation/dev-tools/checkpatch.rst b/Documentation/dev-tools/checkpatch.rst
[]
> + This applies for all non-functional blocks.
> + However, there is one special case, namely functions: they have the
> + opening brace at the beginning of the next line, thus::
> +
> + int function(int x)
> + {
> + body of function
> + }
> +
> + Ref: `Documentation/process/coding-style.rst section 3`

Ideally, these Ref: entries should use a form with the specific section
to jump to. For example:

Ref: `https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces`

Perhaps "See: " might be better than "Ref: "

See: `https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces`

> + **CODE_INDENT**
> + Code indent should use tabs instead of spaces.
> + Outside of comments, documentation and Kconfig,
> + spaces are never used for indentation.
> + Ref: `Documentation/process/coding-style.rst section 1`

See: `https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation`

etc...