lkml.org 
[lkml]   [2010]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] scripts/checkpatch.pl: Add check for k.alloc GFP as first argument
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



\
 
 \ /
  Last update: 2010-11-01 23:11    [W:0.584 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site