checkpatch: fix macro argument precedence test
[sfrench/cifs-2.6.git] / scripts / checkpatch.pl
index e16d6713f2368473d96eaec321fda1685cb3cac5..2d42eb9cd1a5639637df3f1fec35b4216d1c5fa5 100755 (executable)
@@ -5041,7 +5041,7 @@ sub process {
                                $tmp_stmt =~ s/\b(typeof|__typeof__|__builtin\w+|typecheck\s*\(\s*$Type\s*,|\#+)\s*\(*\s*$arg\s*\)*\b//g;
                                $tmp_stmt =~ s/\#+\s*$arg\b//g;
                                $tmp_stmt =~ s/\b$arg\s*\#\#//g;
-                               my $use_cnt = $tmp_stmt =~ s/\b$arg\b//g;
+                               my $use_cnt = () = $tmp_stmt =~ /\b$arg\b/g;
                                if ($use_cnt > 1) {
                                        CHK("MACRO_ARG_REUSE",
                                            "Macro argument reuse '$arg' - possible side-effects?\n" . "$herectx");