lkml.org 
[lkml]   [2012]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v4] checkpatch: debugfs_remove() can take NULL
From
Date
On Tue, 2012-11-20 at 14:29 +0000, Andy Whitcroft wrote:

> This all looks sensible, though we still have three blocks doing the
> same thing. How about we standardise this check into a single check,
> generating the capacity from the matched name.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> + if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) {
> + my $func = $1;
> + my $func_capacity = "NEEDLESS_$1";
> +
> + $func_capacity =~ s/(.$)/\U$1\E/;
> +
> + WARN($func_capacity,
> + "$func(NULL) is safe this check is probably not required\n" . $hereprev);

Perhaps just
WARN("NEEDLESS_IF",
...




\
 
 \ /
  Last update: 2012-11-20 16:21    [W:0.060 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site