checkpatch: add warning for avoiding .L prefix symbols in assembly files
[sfrench/cifs-2.6.git] / scripts / checkpatch.pl
index a04df2657d49a20ddc48a2f0ba6d7e14e7980e8a..d8793bdbc49294cdd10a2b5c2feea4de934938c5 100755 (executable)
@@ -3599,6 +3599,13 @@ sub process {
                        }
                }
 
+# check for .L prefix local symbols in .S files
+               if ($realfile =~ /\.S$/ &&
+                   $line =~ /^\+\s*(?:[A-Z]+_)?SYM_[A-Z]+_(?:START|END)(?:_[A-Z_]+)?\s*\(\s*\.L/) {
+                       WARN("AVOID_L_PREFIX",
+                            "Avoid using '.L' prefixed local symbol names for denoting a range of code via 'SYM_*_START/END' annotations; see Documentation/asm-annotations.rst\n" . $herecurr);
+               }
+
 # check we are in a valid source file C or perl if not then ignore this hunk
                next if ($realfile !~ /\.(h|c|pl|dtsi|dts)$/);