linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] checkpatch: update $logFunctions
@ 2017-01-13  7:38 miles.chen
  2017-01-13  8:14 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: miles.chen @ 2017-01-13  7:38 UTC (permalink / raw)
  To: apw, joe; +Cc: linux-kernel, wsd_upstream, Miles Chen

From: Miles Chen <miles.chen@mediatek.com>

Currently checkpatch.pl does not recognize printk_deferred* functions as
log functions and complains about the line length of printk_deferred*
functoins.  Add printk_deferred* to logFunctions to fix it.

Signed-off-by: Miles Chen <miles.chen@mediatek.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 982c52c..2b63f12 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -425,7 +425,7 @@ our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b};
 
 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-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN|deferred)(?:_ratelimited|_once|)|
 	WARN(?:_RATELIMIT|_ONCE|)|
 	panic|
 	MODULE_[A-Z_]+|
-- 
1.9.1

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

* Re: [PATCH] checkpatch: update $logFunctions
  2017-01-13  7:38 [PATCH] checkpatch: update $logFunctions miles.chen
@ 2017-01-13  8:14 ` Joe Perches
  2017-01-16  2:57   ` Miles Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2017-01-13  8:14 UTC (permalink / raw)
  To: miles.chen, apw; +Cc: linux-kernel, wsd_upstream

On Fri, 2017-01-13 at 15:38 +0800, miles.chen@mediatek.com wrote:
> From: Miles Chen <miles.chen@mediatek.com>
> 
> Currently checkpatch.pl does not recognize printk_deferred* functions as
> log functions and complains about the line length of printk_deferred*
> functoins.  Add printk_deferred* to logFunctions to fix it.

Hi Miles.

Good idea, perhaps less good an implementation though.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -425,7 +425,7 @@ our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b};
>  
>  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-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN|deferred)(?:_ratelimited|_once|)|

This should be a change on the line above like

	printk(?:_ratelimited|_once|_deferred|_deferred_once|)|

without a change on your suggested line.

Or perhaps changing both lines if there are to be
macros/functions like pr_<level>_deferred_once someday.

  	printk(?:_ratelimited|_once|_deferred|_deferred_once|)|
	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|_deferred|deferred_once|)|

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

* Re: [PATCH] checkpatch: update $logFunctions
  2017-01-13  8:14 ` Joe Perches
@ 2017-01-16  2:57   ` Miles Chen
  2017-01-16  3:14     ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Miles Chen @ 2017-01-16  2:57 UTC (permalink / raw)
  To: Joe Perches; +Cc: apw, linux-kernel, wsd_upstream

On Fri, 2017-01-13 at 00:14 -0800, Joe Perches wrote:
> On Fri, 2017-01-13 at 15:38 +0800, miles.chen@mediatek.com wrote:
> > From: Miles Chen <miles.chen@mediatek.com>
> > 
> > Currently checkpatch.pl does not recognize printk_deferred* functions as
> > log functions and complains about the line length of printk_deferred*
> > functoins.  Add printk_deferred* to logFunctions to fix it.
> 
> Hi Miles.
> 
> Good idea, perhaps less good an implementation though.
> 
> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -425,7 +425,7 @@ our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b};
> >  
> >  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-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN|deferred)(?:_ratelimited|_once|)|
> 
> This should be a change on the line above like
> 
> 	printk(?:_ratelimited|_once|_deferred|_deferred_once|)|
> 
> without a change on your suggested line.

Hi Joe,

Thanks for your advice, I'll modify my patch and submit it again.

thanks,
Miles

> 
> Or perhaps changing both lines if there are to be
> macros/functions like pr_<level>_deferred_once someday.
> 
>   	printk(?:_ratelimited|_once|_deferred|_deferred_once|)|
> 	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|_deferred|deferred_once|)|
> 

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

* Re: [PATCH] checkpatch: update $logFunctions
  2017-01-16  2:57   ` Miles Chen
@ 2017-01-16  3:14     ` Joe Perches
  0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2017-01-16  3:14 UTC (permalink / raw)
  To: Miles Chen; +Cc: apw, linux-kernel, wsd_upstream

On Mon, 2017-01-16 at 10:57 +0800, Miles Chen wrote:
> On Fri, 2017-01-13 at 00:14 -0800, Joe Perches wrote:
> > On Fri, 2017-01-13 at 15:38 +0800, miles.chen@mediatek.com wrote:
> > > From: Miles Chen <miles.chen@mediatek.com>
> > > 
> > > Currently checkpatch.pl does not recognize printk_deferred* functions as
> > > log functions and complains about the line length of printk_deferred*
> > > functoins.  Add printk_deferred* to logFunctions to fix it.
> > 
> > Hi Miles.
> > 
> > Good idea, perhaps less good an implementation though.
> > 
> > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> > 
> > []
> > > @@ -425,7 +425,7 @@ our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b};
> > >  
> > >  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-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN|deferred)(?:_ratelimited|_once|)|
> > 
> > This should be a change on the line above like
> > 
> > 	printk(?:_ratelimited|_once|_deferred|_deferred_once|)|

> Thanks for your advice, I'll modify my patch and submit it again.


Hello again Miles.

Actually, because perl matches the shortest match first,
the deferred_once should be before the deferred above so
deferred_once matches properly too.  ie:

	printk(?:_ratelimited|_once|_deferred_once|_deferred|)|

> > Or perhaps changing both lines if there are to be
> > macros/functions like pr_<level>_deferred_once someday.
> > 
> >   	printk(?:_ratelimited|_once|_deferred|_deferred_once|)|
> > 	(?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|_deferred|deferred_once|)|

Here too for both lines if you submit this one.

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

end of thread, other threads:[~2017-01-16  3:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13  7:38 [PATCH] checkpatch: update $logFunctions miles.chen
2017-01-13  8:14 ` Joe Perches
2017-01-16  2:57   ` Miles Chen
2017-01-16  3:14     ` 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).