All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Aditya Srivastava <yashsri421@gmail.com>
Cc: linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH v2] checkpatch: add fix option for NETWORKING_BLOCK_COMMENT_STYLE
Date: Wed, 18 Nov 2020 20:00:54 +0100	[thread overview]
Message-ID: <CAKXUXMw=NnO4pU01bmTH+pkLckcJzByPktGJPuLf9st+x4VbXQ@mail.gmail.com> (raw)
In-Reply-To: <20201118173950.32660-1-yashsri421@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 2317 bytes --]

On Mi., 18. Nov. 2020 at 18:40, Aditya Srivastava <yashsri421@gmail.com>
wrote:

> Currently, checkpatch warns us for files in 'net/' and 'drivers/net',
> if we use an empty '/*' line for comment and contents of comments are
> in next line
>
> E.g., running checkpatch on commit 0d52497ac8ee ("iwlwifi: pcie: remove
> the refs / unrefs from the transport") reports this warning:
>
> WARNING: networking block comments don't use an empty /* line, use /*
> Comment...
> +               /*
> +                * If the TXQ is active, then set the timer, if not,
>
> Provide a fix by appending the current line contents to previous line
> and removing the current line
>

Patch generally looks good.

Can you check how many comments in net actually follow that style and how
many follow another style?


Lukas


> Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
> ---
> Changes in v2: modify commit message: add information about networking
> files in commit message
>
>  scripts/checkpatch.pl | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index f61ac7456151..90e863d63097 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3629,8 +3629,14 @@ sub process {
>                     $prevrawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
>                     $rawline =~ /^\+[ \t]*\*/ &&
>                     $realline > 3) { # Do not warn about the initial
> copyright comment block after SPDX-License-Identifier
> -                       WARN("NETWORKING_BLOCK_COMMENT_STYLE",
> -                            "networking block comments don't use an empty
> /* line, use /* Comment...\n" . $hereprev);
> +                       if (WARN("NETWORKING_BLOCK_COMMENT_STYLE",
> +                                "networking block comments don't use an
> empty /* line, use /* Comment...\n" . $hereprev) &&\
> +                           $fix) {
> +                               if ($rawline =~ /^\+[ \t]*\*\s*(.*)/) {
> +                                       fix_delete_line($fixlinenr,
> $rawline);
> +                                       $fixed[$fixlinenr - 1] .= " $1";
> +                               }
> +                       }
>                 }
>
>  # Block comments use * on subsequent lines
> --
> 2.17.1
>
>

[-- Attachment #1.2: Type: text/html, Size: 3735 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2020-11-18 19:01 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 17:09 [Linux-kernel-mentees] [PATCH] checkpatch: add fix option for NETWORKING_BLOCK_COMMENT_STYLE Aditya Srivastava
2020-11-18 17:13 ` Aditya
2020-11-18 17:39   ` [Linux-kernel-mentees] [PATCH v2] " Aditya Srivastava
2020-11-18 19:00     ` Lukas Bulwahn [this message]
2020-11-19 10:44       ` Aditya
2020-11-21 12:09         ` Aditya
2020-11-22  6:52         ` Lukas Bulwahn
2020-11-25  7:02           ` Aditya
2020-11-25  7:19             ` Lukas Bulwahn
2020-11-25 12:38               ` Lukas Bulwahn
2020-11-29 14:58                 ` Aditya
2020-11-30 10:10                   ` Lukas Bulwahn
2020-11-30 16:47                     ` Aditya
2020-11-30 16:57                       ` Lukas Bulwahn
2020-11-30 17:50                         ` Aditya
2020-12-20 18:33                         ` [Linux-kernel-mentees] [PATCH] checkpatch: ignore files not following NETWORKING_BLOCK_COMMENT_STYLE Aditya Srivastava
2020-12-20 18:54                           ` Aditya
2020-12-21  5:27                           ` Lukas Bulwahn
2020-12-21 15:29                             ` Aditya
2020-12-21 15:58                               ` Lukas Bulwahn

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='CAKXUXMw=NnO4pU01bmTH+pkLckcJzByPktGJPuLf9st+x4VbXQ@mail.gmail.com' \
    --to=lukas.bulwahn@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=yashsri421@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.