From: Leo Yan <leo.yan@linaro.org>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
linux-kernel@vger.kernel.org
Cc: Leo Yan <leo.yan@linaro.org>
Subject: [PATCH] checkpatch: Fix checks for Kconfig help text
Date: Fri, 10 Nov 2017 14:32:37 +0800 [thread overview]
Message-ID: <1510295557-11950-1-git-send-email-leo.yan@linaro.org> (raw)
If one patch has Kconfig section with only one 'config', then variable
'$is_start' will be set by first 'config' line and '$is_end' set by the
second 'config' line. But patches often has only one 'config' line so
we have no chance to set '$is_end', as result below condition is invalid
and it skips check for Kconfig description:
if ($is_start && $is_end && $length < $min_conf_desc_length) {
......
}
When script runs to this condition sentence it means the Kconfig
section parsing has been completed, whatever '$is_end' is true
or not. So removes '$is_end' from condition sentence.
Another change is to change '$min_conf_desc_length' from 4 to 1; so can
pass the check if the Kconfig description has at least one line.
Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
scripts/checkpatch.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 3453df9..ba724b0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -51,7 +51,7 @@ my $configuration_file = ".checkpatch.conf";
my $max_line_length = 80;
my $ignore_perl_version = 0;
my $minimum_perl_version = 5.10.0;
-my $min_conf_desc_length = 4;
+my $min_conf_desc_length = 1;
my $spelling_file = "$D/spelling.txt";
my $codespell = 0;
my $codespellfile = "/usr/share/codespell/dictionary.txt";
@@ -2796,7 +2796,7 @@ sub process {
}
$length++;
}
- if ($is_start && $is_end && $length < $min_conf_desc_length) {
+ if ($is_start && $length < $min_conf_desc_length) {
WARN("CONFIG_DESCRIPTION",
"please write a paragraph that describes the config symbol fully\n" . $herecurr);
}
--
2.7.4
next reply other threads:[~2017-11-10 6:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 6:32 Leo Yan [this message]
2017-11-10 6:39 ` Leo Yan
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=1510295557-11950-1-git-send-email-leo.yan@linaro.org \
--to=leo.yan@linaro.org \
--cc=apw@canonical.com \
--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
all inboxes | Powered by JetHome®