linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net] checkpatch: modify logFunction regular expression to allow repeated front tags
@ 2013-06-19 10:38 Jeff Kirsher
  2013-06-19 13:42 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Jeff Kirsher @ 2013-06-19 10:38 UTC (permalink / raw)
  To: apw, joe; +Cc: Jacob Keller, linux-kernel, netdev, Jeff Kirsher

From: Jacob Keller <jacob.e.keller@intel.com>

The previous logFunction regular expression allowed names for log functions like
dev_warn or e_dbg and so forth, but some log functions are of the forms
similar to e_dev_warn, (adding an additional tag in front of a standard name
like dev_warn).

This patch modifies checkpatch to enable use of this type of log function name.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index b954de5..a38d71e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -269,7 +269,7 @@ our $typeTypedefs = qr{(?x:
 
 our $logFunctions = qr{(?x:
 	printk(?:_ratelimited|_once|)|
-	[a-z0-9]+_(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
+	(?:[a-z0-9]+_)+(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
 	WARN(?:_RATELIMIT|_ONCE|)|
 	panic|
 	MODULE_[A-Z_]+
-- 
1.7.11.7


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [net] checkpatch: modify logFunction regular expression to allow repeated front tags
  2013-06-19 10:38 [net] checkpatch: modify logFunction regular expression to allow repeated front tags Jeff Kirsher
@ 2013-06-19 13:42 ` Joe Perches
  2013-06-19 22:06   ` Keller, Jacob E
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2013-06-19 13:42 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: apw, Jacob Keller, linux-kernel, netdev

On Wed, 2013-06-19 at 03:38 -0700, Jeff Kirsher wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> The previous logFunction regular expression allowed names for log functions like
> dev_warn or e_dbg and so forth, but some log functions are of the forms
> similar to e_dev_warn, (adding an additional tag in front of a standard name
> like dev_warn).

Perhaps names like foo_bar_baz_dev_warn are a bit long.

Maybe instead of
+	(?:[a-z0-9]+_)+(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
use
+	(?:[a-z0-9]+_){0,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|



^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [net] checkpatch: modify logFunction regular expression to allow repeated front tags
  2013-06-19 13:42 ` Joe Perches
@ 2013-06-19 22:06   ` Keller, Jacob E
  2013-06-19 22:49     ` [PATCH v2] checkpatch: Allow longer logging function names Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Keller, Jacob E @ 2013-06-19 22:06 UTC (permalink / raw)
  To: Joe Perches, Kirsher, Jeffrey T; +Cc: apw, linux-kernel, netdev

> -----Original Message-----
> From: Joe Perches [mailto:joe@perches.com]
> Sent: Wednesday, June 19, 2013 6:42 AM
> To: Kirsher, Jeffrey T
> Cc: apw@canonical.com; Keller, Jacob E; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org
> Subject: Re: [net] checkpatch: modify logFunction regular expression to
> allow repeated front tags
> 
> On Wed, 2013-06-19 at 03:38 -0700, Jeff Kirsher wrote:
> > From: Jacob Keller <jacob.e.keller@intel.com>
> >
> > The previous logFunction regular expression allowed names for log
> functions like
> > dev_warn or e_dbg and so forth, but some log functions are of the
> forms
> > similar to e_dev_warn, (adding an additional tag in front of a standard
> name
> > like dev_warn).
> 
> Perhaps names like foo_bar_baz_dev_warn are a bit long.
> 
> Maybe instead of
> +	(?:[a-z0-
> 9]+_)+(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug
> |dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
> use
> +	(?:[a-z0-
> 9]+_){0,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|de
> bug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)|
> 

That sounds good to me.

- Jake


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] checkpatch: Allow longer logging function names
  2013-06-19 22:06   ` Keller, Jacob E
@ 2013-06-19 22:49     ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2013-06-19 22:49 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jacob Keller, Jeff Kirsher, Andy Whitcroft, Aaron Brown,
	linux-kernel, netdev

From: Jacob Keller <jacob.e.keller@intel.com>

The current $logFunction regular expression allows names like
dev_warn, e_dbg, netdev_info, etc, but some log functions are now
written like e_dev_warn, so allow 1 or 2 word blocks with an
underscore before the logging level.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
jp: Modified Jacob's patch and commit message to limit the number of
    word blocks because foo_bar_baz_dev_warn is just too long to live.

 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7e8aa1b..1034c9b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -280,7 +280,7 @@ our $typeTypedefs = qr{(?x:
 
 our $logFunctions = qr{(?x:
 	printk(?:_ratelimited|_once|)|
-	[a-z0-9]+_(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_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|)|
 	panic|
 	MODULE_[A-Z_]+
-- 
1.8.1.2.459.gbcd45b4.dirty


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-06-19 22:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-19 10:38 [net] checkpatch: modify logFunction regular expression to allow repeated front tags Jeff Kirsher
2013-06-19 13:42 ` Joe Perches
2013-06-19 22:06   ` Keller, Jacob E
2013-06-19 22:49     ` [PATCH v2] checkpatch: Allow longer logging function names Joe Perches

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).