From 5dc67c9525fb6894c51ef40147055ce1bef7bf47 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 23 Jul 2008 21:29:04 -0700 Subject: [PATCH] --- yaml --- r: 105393 b: refs/heads/master c: 4c432a8f0134504814aa8dcce6cc57c89d175604 h: refs/heads/master i: 105391: ab63d849bd2c4b7ad80076c55245a92b2181af55 v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 78617318685b..6e7a361efeca 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f5fe35dd95549b1b419cdeb2ec3fe61fda94fa93 +refs/heads/master: 4c432a8f0134504814aa8dcce6cc57c89d175604 diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index 13d7a330b5dd..a4e8087a0cae 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -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$/)) {