lkml.org 
[lkml]   [2021]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: rtl8723bs: align comments
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:)

\
 
 \ /
  Last update: 2021-03-11 17:40    [W:0.038 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site