public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@canonical.com>
To: Joe Perches <joe@perches.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] checkpatch.pl: Allow > 80 char lines for logging functions not just printk
Date: Mon, 26 Oct 2009 11:16:42 +0000	[thread overview]
Message-ID: <20091026111642.GE12089@shadowen.org> (raw)
In-Reply-To: <1254528604.1799.185.camel@Joe-Laptop.home>

On Fri, Oct 02, 2009 at 05:10:04PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 87bbb8b..ae74ab1 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -186,6 +186,14 @@ our $typeTypedefs = qr{(?x:
>  	atomic_t
>  )};
>  
> +our $logFunctions = qr{(?x:
> +	printk|
> +	pr_(debug|dbg|vdbg|devel|info|warning|err|notice|alert|crit|emerg|cont)|
> +	dev_(printk|dbg|vdbg|info|warn|err|notice|alert|crit|emerg|WARN)|
> +	WARN|
> +	panic
> +)};
> +
>  our @typeList = (
>  	qr{void},
>  	qr{(?:unsigned\s+)?char},
> @@ -1367,7 +1375,7 @@ sub process {
>  #80 column limit
>  		if ($line =~ /^\+/ && $prevrawline !~ /\/\*\*/ &&
>  		    $rawline !~ /^.\s*\*\s*\@$Ident\s/ &&
> -		    $line !~ /^\+\s*printk\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
> +		    $line !~ /^\+\s*$logFunctions\s*\(\s*(?:KERN_\S+\s*)?"[X\t]*"\s*(?:,|\)\s*;)\s*$/ &&
>  		    $length > 80)
>  		{
>  			WARN("line over 80 characters\n" . $herecurr);

Yep that looks reasonable to me.  I have a slightly modified version in
my tree.  Will be in the next batch to akpm.

  http://www.kernel.org/pub/linux/kernel/people/apw/checkpatch/checkpatch.pl-testing

-apw

      reply	other threads:[~2009-10-26 11:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-03  0:10 [PATCH] checkpatch.pl: Allow > 80 char lines for logging functions not just printk Joe Perches
2009-10-26 11:16 ` Andy Whitcroft [this message]

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=20091026111642.GE12089@shadowen.org \
    --to=apw@canonical.com \
    --cc=akpm@linux-foundation.org \
    --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