Messages in this thread | | | Subject | Re: [PATCH v3] checkpatch: debugfs_remove() can take NULL | From | Joe Perches <> | Date | Sat, 17 Nov 2012 11:00:46 -0800 |
| |
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
| |