summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorAndy Whitcroft2009-02-27 23:03:07 +0100
committerLinus Torvalds2009-02-28 01:26:21 +0100
commit00ef4ece05096a5c523e265b8ce6627fb5e171c2 (patch)
tree13e3db3b95e04ed3fd53dae599a947c87e87c799 /scripts/checkpatch.pl
parentcheckpatch: do not warn about -p0 patches when checking files (diff)
downloadkernel-qcow2-linux-00ef4ece05096a5c523e265b8ce6627fb5e171c2.tar.gz
kernel-qcow2-linux-00ef4ece05096a5c523e265b8ce6627fb5e171c2.tar.xz
kernel-qcow2-linux-00ef4ece05096a5c523e265b8ce6627fb5e171c2.zip
checkpatch: correctly handle type spacing in the face of modifiers
We need to handle interspersed modifiers in the middle of pointer types, for example: void * __user * __user bar; Signed-off-by: Andy Whitcroft <apw@canonical.com> 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.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5ffc940399be..92d13710ff52 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1658,7 +1658,7 @@ sub process {
# * goes on variable not on type
# (char*[ const])
- if ($line =~ m{\($NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)*)\)}) {
+ if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) {
my ($from, $to) = ($1, $1);
# Should start with a space.
@@ -1673,7 +1673,7 @@ sub process {
if ($from ne $to) {
ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr);
}
- } elsif ($line =~ m{\b$NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)?)($Ident)}) {
+ } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) {
my ($from, $to, $ident) = ($1, $1, $2);
# Should start with a space.