public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: allow uppercase logging function names
@ 2014-12-04  2:38 Wesley Wiser
  2014-12-04  2:47 ` Joe Perches
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wesley Wiser @ 2014-12-04  2:38 UTC (permalink / raw)
  To: kernel-janitors

Some kernel logging functions are prefixed with uppercase letters such
as TP_printk, DUMP_printk, DBG_printk, DEBC_printk, etc. The previous
behavior only allowed logging functions (which may exceed the 80
character line limit) to be prefixed by lowercase letters and numbers.

Signed-off-by: Wesley Wiser <wwiser@gmail.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 374abf4..3b08f1e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -343,7 +343,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|)|
+	(?:[a-zA-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.4.5


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

* Re: [PATCH] checkpatch: allow uppercase logging function names
  2014-12-04  2:38 [PATCH] checkpatch: allow uppercase logging function names Wesley Wiser
@ 2014-12-04  2:47 ` Joe Perches
  2014-12-04  8:54 ` Dan Carpenter
  2014-12-06  3:28 ` Wesley Wiser
  2 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2014-12-04  2:47 UTC (permalink / raw)
  To: kernel-janitors

On Wed, 2014-12-03 at 21:38 -0500, Wesley Wiser wrote:
> Some kernel logging functions are prefixed with uppercase letters such
> as TP_printk, DUMP_printk, DBG_printk, DEBC_printk, etc. The previous
> behavior only allowed logging functions (which may exceed the 80
> character line limit) to be prefixed by lowercase letters and numbers.

I'm not sure that these should be encouraged.
I'd prefer to make these lower case instead.

The regex also allows mixed case like Tp_printk.

Maybe if it was something like
(?:[a-z0-9]+_|[A-Z0-9]+_){1,2}

but it still seems undesirable.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 374abf4..3b08f1e 100755
> --- 
> +++ b/scripts/checkpatch.pl
> @@ -343,7 +343,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|)|
> +	(?:[a-zA-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_]+|




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

* Re: [PATCH] checkpatch: allow uppercase logging function names
  2014-12-04  2:38 [PATCH] checkpatch: allow uppercase logging function names Wesley Wiser
  2014-12-04  2:47 ` Joe Perches
@ 2014-12-04  8:54 ` Dan Carpenter
  2014-12-06  3:28 ` Wesley Wiser
  2 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-12-04  8:54 UTC (permalink / raw)
  To: kernel-janitors

I think you have to CC Andrew Morton for these.  You may as well CC
linux-kernel@vger.kernel.org also although no one reads that.

regards,
dan carpenter


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

* Re: [PATCH] checkpatch: allow uppercase logging function names
  2014-12-04  2:38 [PATCH] checkpatch: allow uppercase logging function names Wesley Wiser
  2014-12-04  2:47 ` Joe Perches
  2014-12-04  8:54 ` Dan Carpenter
@ 2014-12-06  3:28 ` Wesley Wiser
  2 siblings, 0 replies; 4+ messages in thread
From: Wesley Wiser @ 2014-12-06  3:28 UTC (permalink / raw)
  To: kernel-janitors

Hi Joe, 

Thanks for taking a look at this. Do you think I should look into
fixing the casing of these functions instead? Some of these functions
look like they're being called in a lot of places. TP_printk, for
example, is getting called over 1000 times according to git grep. 

Wesley Wiser

On Wed, 2014-12-03 at 18:47 -0800, Joe Perches wrote:
> I'm not sure that these should be encouraged.
> I'd prefer to make these lower case instead.
> 
> The regex also allows mixed case like Tp_printk.
> 
> Maybe if it was something like
> (?:[a-z0-9]+_|[A-Z0-9]+_){1,2}
> 
> but it still seems undesirable.



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

end of thread, other threads:[~2014-12-06  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04  2:38 [PATCH] checkpatch: allow uppercase logging function names Wesley Wiser
2014-12-04  2:47 ` Joe Perches
2014-12-04  8:54 ` Dan Carpenter
2014-12-06  3:28 ` Wesley Wiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox