From: Joe Perches <joe@perches.com>
To: Petr Tesarik <petr@tesarici.cz>,
Andy Whitcroft <apw@canonical.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
open list <linux-kernel@vger.kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH v2] checkpatch: warn about multi-line comments without an empty /* line
Date: Tue, 26 Sep 2023 12:56:33 -0700 [thread overview]
Message-ID: <1adcfeaa4bd01d59a349daa697cc007e81bc81b1.camel@perches.com> (raw)
In-Reply-To: <20230926192400.19366-1-petr@tesarici.cz>
On Tue, 2023-09-26 at 21:24 +0200, Petr Tesarik wrote:
> According to Documentation/process/coding-style.rst, the preferred style
> for multi-line comments outside net/ and drivers/net/ is:
>
> .. code-block:: c
>
> /*
> * This is the preferred style for multi-line
> * comments in the Linux kernel source code.
> * Please use it consistently.
> *
> * Description: A column of asterisks on the left side,
> * with beginning and ending almost-blank lines.
> */
>
> Signed-off-by: Petr Tesarik <petr@tesarici.cz>
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -4006,6 +4006,14 @@ sub process {
> "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
> }
>
> +# Non-networking without an initial /*
> + if ($realfile !~ m@^(drivers/net/|net/)@ &&
> + $prevrawline =~ /^\+[ \t]*\/\*.*[^ \t]$/ &&
> + $rawline =~ /^\+[ \t]*\*/) {
> + WARN("BLOCK_COMMENT_STYLE",
> + "multi-line block comments should start with an empty /* line\n" . $hereprev);
> + }
> +
> # Block comments use * on subsequent lines
> if ($prevline =~ /$;[ \t]*$/ && #ends in comment
> $prevrawline =~ /^\+.*?\/\*/ && #starting /*
Still nack. Too many existing instances.
$ git grep '/\*.*' -- '*.[ch]' | \
grep -v '/\*.*\*/' | \
grep -v -P "/\*\s*$" | \
grep -v '/\*\*' | \
grep -v "SPDX-License" | \
grep -v -P '^drivers/net|^net/' | \
wc -l
51834
next prev parent reply other threads:[~2023-09-26 19:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 19:24 Petr Tesarik
2023-09-26 19:56 ` Joe Perches [this message]
2023-09-26 20:16 ` Petr Tesařík
2023-09-26 20:39 ` Joe Perches
2023-09-27 6:19 ` Petr Tesařík
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=1adcfeaa4bd01d59a349daa697cc007e81bc81b1.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=catalin.marinas@arm.com \
--cc=dwaipayanray1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=petr@tesarici.cz \
/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
all inboxes | Powered by JetHome®