checkpatch: fix __attribute__ matching
[firefly-linux-kernel-4.4.55.git] / scripts / checkpatch.pl
index cb2dac37aaffec2f8669cf2b08ab782211c48160..ba105a84839674acfa069baab2508c926cadd5ad 100755 (executable)
@@ -1669,8 +1669,8 @@ sub process {
                }
 
 # check for initialisation to aggregates open brace on the next line
-               if ($prevline =~ /$Declare\s*$Ident\s*=\s*$/ &&
-                   $line =~ /^.\s*{/) {
+               if ($line =~ /^.\s*{/ &&
+                   $prevline =~ /(?:^|[^=])=\s*$/) {
                        ERROR("that open brace { should be on the previous line\n" . $hereprev);
                }