[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <jpg4mmwqcdv.fsf@aqua.home.waltham>
Date: Thu, 28 May 2015 23:41:00 -0400
From: Bandan Das <bsd@...efile.in>
To: joe@...ches.com
Cc: linux-kernel@...r.kernel.org
Subject: do not initialise globals to 0 or NULL\n
Hi Joe,
Sorry, I am very Perl illiterate but I was deliberately trying to hit the
"do not initialize globals" message from checkpatch.pl and can't seem to.
Looking at the corresponding regexp, it seems the correct pattern should be:
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 89b1df4..d076d39 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3169,7 +3169,7 @@ sub process {
}
# check for global initialisers.
- if ($line =~ /^\+(\s*$Type\s*$Ident\s*(?:\s+$Modifier))*\s*=\s*(0|NULL|false)\s*;/) {
+ if ($line =~ /^\+(\s*$Type\s*$Ident\s*(?:\s+$Modifier)*)\s*=\s*(0|NULL|false)\s*;/) {
if (ERROR("GLOBAL_INITIALISERS",
"do not initialise globals to 0 or NULL\n" .
$herecurr) &&
which matches zero or more of $Modifier followed by zero or more of a space.
Or am I missing something ?
Thanks,
Bandan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists