linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
	Fabio Aiuto <fabioaiuto83@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: align comments
Date: Thu, 11 Mar 2021 01:15:34 -0800	[thread overview]
Message-ID: <379d4b58d82be1f871924c89e0db7bab367564fb.camel@perches.com> (raw)
In-Reply-To: <20210310174830.GM2087@kadam>

On Wed, 2021-03-10 at 20:48 +0300, Dan Carpenter wrote:
> You need to have a space character after the '*'.

Perhaps YA checkpatch test...
---
 scripts/checkpatch.pl | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f42e5ba16d9b..0de553d52605 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3876,6 +3876,21 @@ sub process {
 			}
 		}
 
+# Independent comment lines should have a space after the comment initiator
+		if ($line =~ /^\+[ \t]*($;+)/) {		#leading comment
+			my $comment = trim(substr($rawline, $-[1], $+[1] - $-[1]));
+			if ($comment =~ m{^(/\*|\*/|\*|//)(.*)}) {
+				my $init = $1;
+				my $rest = $2;
+				if ($init =~ m{^(?:/\*|\*|//)$} &&
+				    $rest ne '' &&
+				    $rest !~ /^[\s\*=\-]/) {
+					WARN("COMMENT_STYLE",
+					     "Comments generally use whitespace after the comment initiator\n" . $herecurr);
+				}
+			}
+		}
+
 # check for missing blank lines after struct/union declarations
 # with exceptions for various attributes and macros
 		if ($prevline =~ /^[\+ ]};?\s*$/ &&


  reply	other threads:[~2021-03-11  9:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-10 15:37 [PATCH] staging: rtl8723bs: align comments Fabio Aiuto
2021-03-10 15:51 ` Greg KH
2021-03-10 21:58   ` Fabio Aiuto
2021-03-10 22:13     ` Fabio Aiuto
2021-03-10 22:27     ` Eric Curtin
2021-03-10 22:45       ` Fabio Aiuto
2021-03-12  9:15       ` Fabio Aiuto
     [not found]     ` <CANiq72mEdHhJoCEmD0DD7QGP57soF3DGGoFNb89WF-4Oh_sscg@mail.gmail.com>
2021-03-11 13:31       ` Fabio Aiuto
2021-03-10 17:48 ` Dan Carpenter
2021-03-11  9:15   ` Joe Perches [this message]
2021-03-11 16:38     ` Fabio Aiuto

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=379d4b58d82be1f871924c89e0db7bab367564fb.camel@perches.com \
    --to=joe@perches.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).