]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - scripts/checkpatch.pl
checkpatch: usb_free_urb() can take NULL
[linux-2.6-omap-h63xx.git] / scripts / checkpatch.pl
index 13d7a330b5dd07cbdcd287447fbac0237afc09e2..a4e8087a0cae4188daff371e66270f6b621485b6 100755 (executable)
@@ -2078,6 +2078,13 @@ sub process {
                                WARN("kfree(NULL) is safe this check is probabally not required\n" . $hereprev);
                        }
                }
+# check for needless usb_free_urb() checks
+               if ($prevline =~ /\bif\s*\(([^\)]*)\)/) {
+                       my $expr = $1;
+                       if ($line =~ /\busb_free_urb\(\Q$expr\E\);/) {
+                               WARN("usb_free_urb(NULL) is safe this check is probably not required\n" . $hereprev);
+                       }
+               }
 
 # warn about #ifdefs in C files
 #              if ($line =~ /^.\s*\#\s*if(|n)def/ && ($realfile =~ /\.c$/)) {