From: Joe Perches <joe@perches.com>
To: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: lukas.bulwahn@gmail.com,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 0/2] checkpatch: add verbose mode
Date: Sat, 20 Feb 2021 07:14:46 -0800 [thread overview]
Message-ID: <cda9541eb8cff5cbba178d6a6d511a46f193aab1.camel@perches.com> (raw)
In-Reply-To: <20210220120220.32585-1-dwaipayanray1@gmail.com>
On Sat, 2021-02-20 at 17:32 +0530, Dwaipayan Ray wrote:
> Add a new verbose mode to checkpatch. The verbose test
> descriptions are read from the checkpatch documentation
> file at `Documentation/dev-tools/checkpatch.rst`.
>
> The verbose mode is optional and can be enabled by the
> flag -v or --verbose.
>
> The documentation file is only parsed by checkpatch.pl
> if the verbose mode is enabled. The verbose mode can
> not be used together with the --terse option.
>
> Changes in v5:
> - Change the reference format to use absolute links.
> - Print verbose descriptions only for the first time
> a message type is encountered.
OK, I think a nice addition would be to add --verbose
text to the --list-types option when used together.
$ ./scripts/checkpatch.pl --list-types --verbose
1 ALLOC_ARRAY_ARGS
The first argument for kcalloc or kmalloc_array should be the
number of elements. sizeof() as the first argument is generally
wrong.
See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html
2 ALLOC_SIZEOF_STRUCT
The allocation style is bad. In general for family of
allocation functions using sizeof() to get memory size,
constructs like::
p = alloc(sizeof(struct foo), ...)
should be::
p = alloc(sizeof(*p), ...)
See: https://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memory
etc...
prev parent reply other threads:[~2021-02-20 15:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-20 12:02 [PATCH v5 0/2] checkpatch: add verbose mode Dwaipayan Ray
2021-02-20 12:02 ` [PATCH v5 1/2] " Dwaipayan Ray
2021-02-20 12:02 ` [PATCH v5 2/2] docs: add documentation for checkpatch Dwaipayan Ray
2021-02-20 15:14 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cda9541eb8cff5cbba178d6a6d511a46f193aab1.camel@perches.com \
--to=joe@perches.com \
--cc=dwaipayanray1@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).