From: Joe Perches <joe@perches.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Greg KH <gregkh@linuxfoundation.org>
Cc: carlis <zhangxuezhi3@gmail.com>,
Andy Whitcroft <apw@canonical.com>,
devel@driverdev.osuosl.org, linux-fbdev@vger.kernel.org,
mh12gx2825@gmail.com, oliver.graute@kococonnector.com,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
sbrivio@redhat.com, colin.king@canonical.com,
zhangxuezhi1@yulong.com
Subject: Re: [PATCH v10] staging: fbtft: add tearing signal detect
Date: Wed, 27 Jan 2021 10:21:30 -0800 [thread overview]
Message-ID: <2efe84eefdfd21da68d323a6e32b4ad84bc0fa6b.camel@perches.com> (raw)
In-Reply-To: <20210127144946.GF2696@kadam>
> Comments are the exception to the "no spaces at the start of a line"
> rule. I was expecting that the kbuild-bot would send a Smatch warning
> for inconsistent indenting, but comments are not counted there either.
>
> I'm sort of surprised that we don't have checkpatch rule about the
> missing space characters. It should be: "/* Tearing Effect Line On */".
Maybe this but the "preceded by a tab" test is pretty noisy.
---
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4f8494527139..72347e82d384 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3720,6 +3720,22 @@ sub process {
s/(\(\s*$Type\s*\))[ \t]+/$1/;
}
}
+
+# Comment styles
+# Initial comment only lines that have a leading space
+ if ($rawline =~ m{^\+([ \t]+)(?:/\*|//)} && $1 =~ / /) {
+ WARN("COMMENT_STYLE",
+ "Initial comment lines should be indented only with tabs\n" . $herecurr);
+# comments not aligned on tabs
+ } elsif ($rawline !~ m{^\+(?:/\*|//)} &&
+ $rawline =~ m{^\+.*[^\t](?:/\*|//)}) {
+ CHK("COMMENT_STYLE",
+ "Comments should generally be preceded by a tab\n" . $herecurr);
+ }
+
+# comment initiators should generally be followed by a space if using words
+ if ($rawline =~ m{^\+.*(?:/\*|//)\w}) {
+ WARN("COMMENT_STYLE",
+ "Comment text should use a space after the comment initiator\n" . $herecurr);
+ }
# Block comment styles
# Networking with an initial /*
next prev parent reply other threads:[~2021-01-27 18:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-27 13:42 [PATCH v10] staging: fbtft: add tearing signal detect Carlis
2021-01-27 13:51 ` Greg KH
2021-01-27 14:08 ` carlis
2021-01-27 14:13 ` Greg KH
2021-01-27 14:17 ` carlis
2021-01-27 14:25 ` Greg KH
2021-01-27 14:49 ` Dan Carpenter
2021-01-27 15:02 ` Greg KH
2021-01-28 1:12 ` carlis
2021-01-27 17:42 ` Joe Perches
2021-01-27 18:21 ` Joe Perches [this message]
2021-01-27 22:32 ` Kari Argillander
2021-01-28 1:42 ` carlis
2021-01-28 6:52 ` Kari Argillander
2021-01-28 9:24 ` carlis
2021-01-28 9:42 ` Geert Uytterhoeven
2021-01-28 9:59 ` Kari Argillander
2021-01-28 11:03 ` carlis
2021-01-28 11:15 ` Geert Uytterhoeven
2021-01-28 11:42 ` carlis
2021-01-28 15:13 ` Dan Carpenter
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=2efe84eefdfd21da68d323a6e32b4ad84bc0fa6b.camel@perches.com \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=colin.king@canonical.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mh12gx2825@gmail.com \
--cc=oliver.graute@kococonnector.com \
--cc=sbrivio@redhat.com \
--cc=zhangxuezhi1@yulong.com \
--cc=zhangxuezhi3@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 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).