All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jj@chaosbits.net>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>
Subject: Re: [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument
Date: Mon, 1 Nov 2010 22:57:51 +0100 (CET)	[thread overview]
Message-ID: <alpine.LNX.2.00.1011012255060.12889@swampdragon.chaosbits.net> (raw)
In-Reply-To: <eee6800a4709ced7a513bd588fa0c16fd5790c80.1288555099.git.joe@perches.com>

On Sun, 31 Oct 2010, Joe Perches wrote:

> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  scripts/checkpatch.pl |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 90b54d4..114f667 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2789,6 +2789,11 @@ sub process {
>  			WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
>  		}
>  
> +# check for k.alloc GFP in wrong location
> +		if ($line =~ /\bk[czm]alloc\s*\(\s*\(?\s*GFP_/) {

Just off the top of my head, but shouldn't this check for \s*_*GFP_ in 
order to catch things like __GFP_ZERO as well?
And what about functions like kmalloc_node()/vmalloc_node() which may also 
have this problem?

> +			ERROR("alloc has GFP_<level> as last argument\n" . $herecurr);
> +		}
> +
>  # check for gcc specific __FUNCTION__
>  		if ($line =~ /__FUNCTION__/) {
>  			WARN("__func__ should be used instead of gcc specific __FUNCTION__\n"  . $herecurr);
> 

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


  reply	other threads:[~2010-11-01 22:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31 22:33 [PATCH 0/4] Fix k.alloc switched arguments Joe Perches
2010-10-31 22:33 ` Joe Perches
2010-10-31 22:33 ` [PATCH 1/4] drivers/gpu/drm/vmwgfx: " Joe Perches
2010-10-31 23:52   ` Matt Turner
2010-11-01 22:00     ` Thomas Hellstrom
2010-10-31 22:33 ` [PATCH 2/4] drivers/scsi/pmcraid.c: " Joe Perches
2010-10-31 22:33 ` [PATCH 3/4] drivers/staging/udlfb/udlfb.c: " Joe Perches
2010-10-31 22:33 ` [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument Joe Perches
2010-11-01 21:57   ` Jesper Juhl [this message]
2010-11-02 22:47 ` [RESEND PATCH 2/4] drivers/scsi/pmcraid.c: Fix k.alloc switched arguments 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=alpine.LNX.2.00.1011012255060.12889@swampdragon.chaosbits.net \
    --to=jj@chaosbits.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.