lkml.org 
[lkml]   [2012]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3] checkpatch: debugfs_remove() can take NULL
From
Date
On Sat, 2012-11-17 at 20:54 +0200, Constantine Shulyupin wrote:
> From: Constantine Shulyupin <const@MakeLinux.com>

Hi Constantine.

> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> +# check for needless debugfs_remove() and debugfs_remove_recursive*() checks
> + if ($line =~ /\b(debugfs_remove(?:_recursive)?)$expr/) {
> + WARN("NEEDLESS_DEBUGFS_REMOVE",
> + "$1(NULL) is safe this check is probably not required\n" . $hereprev);
> + }

OK,

> +# check for needless debugfs_remove_recursive() and debugfs_remove_recursive*() checks
> + if ($line =~ /\b(debugfs_remove_recursive(?:_recursive)?)$expr/) {
> + WARN("NEEDLESS_DEBUGFS_REMOVE_RECURSIVE",
> + "$1(NULL) is safe this check is probably not required\n" . $hereprev);
> + }

You don't need thus second block.
The first check finds both
debugfs_remove(foo)
and
debugfs_remove_recursive(bar)

The second one is redundant



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