Message ID | 1383400074-30555-14-git-send-email-govindarajulu90@gmail.com |
---|---|
State | Rejected, archived |
Delegated to: | David Miller |
Headers | show |
On Sat, 2013-11-02 at 19:17 +0530, Govindarajulu Varadarajan wrote: > Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@gmail.com> [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -3719,7 +3719,7 @@ sub process { > # check for needless "if (<foo>) fn(<foo>)" uses > if ($prevline =~ /\bif\s*\(\s*($Lval)\s*\)/) { > my $expr = '\s*\(\s*' . quotemeta($1) . '\s*\)\s*;'; > - if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) { > + if ($line =~ /\b(kfree|dev_kfree_skb|dev_kfree_skb_any|dev_kfree_skb_irq|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) { > WARN('NEEDLESS_IF', > "$1(NULL) is safe this check is probably not required\n" . $hereprev); > } OK, but I think this is easier to read as dev_kfree_skb(?:_skb|_any|_irq)? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 66cad50..e651b8a 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3719,7 +3719,7 @@ sub process { # check for needless "if (<foo>) fn(<foo>)" uses if ($prevline =~ /\bif\s*\(\s*($Lval)\s*\)/) { my $expr = '\s*\(\s*' . quotemeta($1) . '\s*\)\s*;'; - if ($line =~ /\b(kfree|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) { + if ($line =~ /\b(kfree|dev_kfree_skb|dev_kfree_skb_any|dev_kfree_skb_irq|usb_free_urb|debugfs_remove(?:_recursive)?)$expr/) { WARN('NEEDLESS_IF', "$1(NULL) is safe this check is probably not required\n" . $hereprev); }
Signed-off-by: Govindarajulu Varadarajan <govindarajulu90@gmail.com> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)