Skip to contentSkip to conversation

checkpatch-prefer-strscpy-to-strlcpy.patch removed from -mm tree

merged [email protected] 1 participant 1 message Dec 31, 2020

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: checkpatch: prefer strscpy to strlcpy
has been removed from the -mm tree. Its filename was
checkpatch-prefer-strscpy-to-strlcpy.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Joe Perches <[email protected]>
Subject: checkpatch: prefer strscpy to strlcpy

Prefer strscpy over the deprecated strlcpy function.

---

 scripts/checkpatch.pl |    6 ++++++
 1 file changed, 6 insertions(+)
scripts/checkpatch.pl renamed from scripts/checkpatch.pl~checkpatch-prefer-strscpy-to-strlcpy +6 -0
@@ -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 &&

_

Patches currently in -mm which might be from [email protected] are