From: Joe Perches Date: Thu, 13 Jan 2011 00:59:56 +0000 (-0800) Subject: scripts/checkpatch.pl: add check for multiple terminating semicolons and casts of... X-Git-Tag: v3.0~2382 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=caf2a54f101a55ec318c2a20253a1977802f7de4;p=platform%2Fkernel%2Flinux-amlogic.git scripts/checkpatch.pl: add check for multiple terminating semicolons and casts of vmalloc Signed-off-by: Joe Perches Cc: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e3c7fc0..36d6851 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);