public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom Van Braeckel <tomvanbraeckel@gmail.com>
To: apw@canonical.com, joe@perches.com
Cc: linux-kernel@vger.kernel.org,
	Tom Van Braeckel <tomvanbraeckel@gmail.com>
Subject: [PATCH v2] checkpatch: support more uppercase $logFunctions
Date: Thu, 19 Mar 2015 09:26:41 +0100	[thread overview]
Message-ID: <1426753601-4109-1-git-send-email-tomvanbraeckel@gmail.com> (raw)
In-Reply-To: <1426746080-11905-1-git-send-email-tomvanbraeckel@gmail.com>

Add support for uppercase logging function names (so that they may
exceed 80 cols) and regroup the matched expressions more logically.

Previously, WARN, WARN_RATELIMIT, WARN_ONCE were already supported but
many other uppercase logging functions were not and this caused
unfixable checkpatch warnings (an example: drivers/bluetooth/btusb.c)

Care was taken to avoid being overly broad by adding uppercase logging
functions that do not exist (such as VDBG) or by making everything case
insensitive.

Care was also taken to make sure that previously supported expressions
are still matched (such as WARN_RATELIMIT and WARN_ONCE).

Signed-off-by: Tom Van Braeckel <tomvanbraeckel@gmail.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d124359..18d1ffa 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -352,7 +352,7 @@ our $typeTypedefs = qr{(?x:
 our $logFunctions = qr{(?x:
 	printk(?:_ratelimited|_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|)|
+	(?:[A-Z0-9]+_){1,2}(?:EMERG|ALERT|CRIT|ERR|WARNING|WARN|NOTICE|INFO|DEBUG|DBG|DEVEL)(?:_RATELIMIT|_ONCE|)|
 	panic|
 	MODULE_[A-Z_]+|
 	seq_vprintf|seq_printf|seq_puts
-- 
2.1.0


  reply	other threads:[~2015-03-19  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  6:21 [PATCH] checkpatch: support more uppercase $logFunctions Tom Van Braeckel
2015-03-19  8:26 ` Tom Van Braeckel [this message]
2015-03-19  9:13   ` [PATCH v2] " Joe Perches
2015-03-19  9:57     ` Tom Van Braeckel
2015-03-19 15:02       ` 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=1426753601-4109-1-git-send-email-tomvanbraeckel@gmail.com \
    --to=tomvanbraeckel@gmail.com \
    --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