summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 755f4802a4..4e047586a6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2365,6 +2365,12 @@ sub u_boot_line {
"Use 'if (IS_ENABLED(CONFIG...))' instead of '#if or #ifdef' where possible\n" . $herecurr);
}
+ # prefer strl(cpy|cat) over strn(cpy|cat)
+ if ($line =~ /\bstrn(cpy|cat)\s*\(/) {
+ WARN("STRL",
+ "strl$1 is preferred over strn$1 because it always produces a nul-terminated string\n" . $herecurr);
+ }
+
# use defconfig to manage CONFIG_CMD options
if ($line =~ /\+\s*#\s*(define|undef)\s+(CONFIG_CMD\w*)\b/) {
ERROR("DEFINE_CONFIG_CMD",