checkpatch: prefer strscpy to strlcpy
[linux-2.6-microblaze.git] / scripts / checkpatch.pl
index 0008530..92e888e 100755 (executable)
@@ -6646,6 +6646,12 @@ sub process {
 #                      }
 #              }
 
+# strlcpy uses that should likely be strscpy
+               if ($line =~ /\bstrlcpy\s*\(/) {
+                       WARN("STRLCPY",
+                            "Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw\@mail.gmail.com/\n" . $herecurr);
+               }
+
 # typecasts on min/max could be min_t/max_t
                if ($perl_version_ok &&
                    defined $stat &&