summaryrefslogtreecommitdiff
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-01-12 16:59:56 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 08:03:11 -0800
commitcaf2a54f101a55ec318c2a20253a1977802f7de4 (patch)
tree0eaa61afa0af0754a42b8a1f5c642500c4a54026 /scripts/checkpatch.pl
parent78c377d1b5e7ef15c8c307c2aa2511602a0829c3 (diff)
downloadlwn-caf2a54f101a55ec318c2a20253a1977802f7de4.tar.gz
lwn-caf2a54f101a55ec318c2a20253a1977802f7de4.zip
scripts/checkpatch.pl: add check for multiple terminating semicolons and casts of vmalloc
Signed-off-by: Joe Perches <joe@perches.com> Cc: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e3c7fc0dca38..36d6851f97d0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2785,10 +2785,15 @@ sub process {
}
# check for pointless casting of kmalloc return
- if ($line =~ /\*\s*\)\s*k[czm]alloc\b/) {
+ if ($line =~ /\*\s*\)\s*[kv][czm]alloc(_node){0,1}\b/) {
WARN("unnecessary cast may hide bugs, see http://c-faq.com/malloc/mallocnocast.html\n" . $herecurr);
}
+# check for multiple semicolons
+ if ($line =~ /;\s*;\s*$/) {
+ WARN("Statements terminations use 1 semicolon\n" . $herecurr);
+ }
+
# check for gcc specific __FUNCTION__
if ($line =~ /__FUNCTION__/) {
WARN("__func__ should be used instead of gcc specific __FUNCTION__\n" . $herecurr);