linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fabio Aiuto <fabioaiuto83@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: align comments
Date: Thu, 11 Mar 2021 17:38:40 +0100	[thread overview]
Message-ID: <20210311163838.GA5244@agape.jhs> (raw)
In-Reply-To: <379d4b58d82be1f871924c89e0db7bab367564fb.camel@perches.com>

On Thu, Mar 11, 2021 at 01:15:34AM -0800, Joe Perches wrote:
> 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*$/ &&
> 

Thank you Joe, it works fine. I've just tested it for my particular need but 
I hope it's going to be merged in the mainline if other people will find it useful:)


      reply	other threads:[~2021-03-11 16:39 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
2021-03-11 16:38     ` Fabio Aiuto [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=20210311163838.GA5244@agape.jhs \
    --to=fabioaiuto83@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --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).