checkpatch: pointer type star may have modifiers following
authorAndy Whitcroft <apw@canonical.com>
Fri, 27 Feb 2009 22:03:07 +0000 (14:03 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 28 Feb 2009 00:26:22 +0000 (16:26 -0800)
We may have any modifier following a pointer type star.  Handle this:

void * __user * __user foo;

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>
scripts/checkpatch.pl

index 92d1371..15a5904 100755 (executable)
@@ -1886,11 +1886,11 @@ sub process {
                                        if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) {
                                                ERROR("space required before that '$op' $at\n" . $hereptr);
                                        }
-                                       if ($op eq '*' && $cc =~/\s*const\b/) {
+                                       if ($op eq '*' && $cc =~/\s*$Modifier\b/) {
                                                # A unary '*' may be const
 
                                        } elsif ($ctx =~ /.xW/) {
-                                               ERROR("space prohibited after that '$op' $at\n" . $hereptr);
+                                               ERROR("Aspace prohibited after that '$op' $at\n" . $hereptr);
                                        }
 
                                # unary ++ and unary -- are allowed no space on one side.