public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] checkpatch: Adjust regular expressions in $logFunctions
Date: Tue, 09 May 2017 19:00:06 +0000	[thread overview]
Message-ID: <a2178c87-9229-978d-c94e-6c124755c440@users.sourceforge.net> (raw)

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 9 May 2017 20:40:51 +0200

* Two alternations contained an empty element. Use the question mark
  metacharacter instead to express optional items in the search pattern.

* Some alternation elements shared a common prefix (like an underscore).
  Improve the specification of this detail by more non-capturing groups.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 scripts/checkpatch.pl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4b9569fa931b..8561de02d9b8 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -427,12 +427,12 @@ our $typeTypedefs = qr{(?x:
 our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b};
 
 our $logFunctions = qr{(?x:
-	printk(?:_ratelimited|_once|_deferred_once|_deferred|)|
-	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
-	WARN(?:_RATELIMIT|_ONCE|)|
+	printk(?:_(?:ratelimited|once|deferred(?:_once)?))?|
+	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_(?:ratelimited|once))?|
+	WARN(?:_(?:RATELIMIT|ONCE))?|
 	panic|
 	MODULE_[A-Z_]+|
-	seq_vprintf|seq_printf|seq_puts
+	seq_(?:v?printf|puts)
 )};
 
 our $signature_tags = qr{(?xi:
-- 
2.12.2


             reply	other threads:[~2017-05-09 19:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-09 19:00 SF Markus Elfring [this message]
2017-05-09 20:52 ` [PATCH] checkpatch: Adjust regular expressions in $logFunctions Joe Perches
2017-05-09 21:01   ` SF Markus Elfring
2017-05-09 21:16     ` Joe Perches

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=a2178c87-9229-978d-c94e-6c124755c440@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --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