From: Joe Perches <joe@perches.com>
To: Samuil Ivanov <samuil.ivanovbg@gmail.com>, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH] Staging: gasket: apex_driver: fixed a line over 80 characters coding style issue
Date: Sun, 20 Oct 2019 11:39:24 -0700 [thread overview]
Message-ID: <85fdb8994408f5a04096fe4e212510733275b54f.camel@perches.com> (raw)
In-Reply-To: <20191020175001.22105-1-samuil.ivanovbg@gmail.com>
dOn Sun, 2019-10-20 at 20:50 +0300, Samuil Ivanov wrote:
> Fixed four lines of code that were over 80 characters long.
Some of the 80 column messages that checkpatch emits should
be ignored. These are some of them because each of these
lines is a single very long name (48 chars!) identifier.
Perhaps checkpatch should not warn on these
> diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c
[]
> @@ -263,8 +263,8 @@ static int apex_enter_reset(struct gasket_dev *gasket_dev)
> * - Enable GCB idle
> */
> gasket_read_modify_write_64(gasket_dev, APEX_BAR_INDEX,
> - APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER,
> - 0x0, 1, 32);
> + APEX_BAR2_REG_IDLEGENERATOR_IDLEGEN_IDLEREGISTER,
> + 0x0, 1, 32);
Maybe add a checkpatch test for this and allow ignoring
single identifier lines using LONG_LINE_IDENT
---
o Add a couple missing semicolons too.
scripts/checkpatch.pl | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a85d719df1f4..cdce58be4f66 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3140,13 +3140,14 @@ sub process {
#
# There are a few types of lines that may extend beyond $max_line_length:
# logging functions like pr_info that end in a string
-# lines with a single string
+# lines with a single string or identifier
# #defines that are a single string
# lines with an RFC3986 like URL
#
-# There are 3 different line length message types:
+# There are 4 different line length message types:
# LONG_LINE_COMMENT a comment starts before but extends beyond $max_line_length
# LONG_LINE_STRING a string starts before but extends beyond $max_line_length
+# LONG_LINE_IDENT a single identifier starts before but extends beyond $max_line_length
# LONG_LINE all other lines longer than $max_line_length
#
# if LONG_LINE is ignored, the other 2 types are also ignored
@@ -3183,12 +3184,16 @@ sub process {
# a comment starts before $max_line_length
} elsif ($line =~ /($;[\s$;]*)$/ &&
length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) {
- $msg_type = "LONG_LINE_COMMENT"
+ $msg_type = "LONG_LINE_COMMENT";
# a quoted string starts before $max_line_length
} elsif ($sline =~ /\s*($String(?:\s*(?:\\|,\s*|\)\s*;\s*))?)$/ &&
length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) {
- $msg_type = "LONG_LINE_STRING"
+ $msg_type = "LONG_LINE_STRING";
+ # a single identifier starts before $max_line_length
+ } elsif ($sline =~ /^.\s*($Ident(?:\\|,\s*|\)\s*;\s*))?$/ &&
+ length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) {
+ $msg_type = "LONG_LINE_IDENT";
}
if ($msg_type ne "" &&
prev parent reply other threads:[~2019-10-20 18:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-20 17:50 Samuil Ivanov
2019-10-20 18:39 ` Joe Perches [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=85fdb8994408f5a04096fe4e212510733275b54f.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samuil.ivanovbg@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
all inboxes | Powered by JetHome®