mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
checkpatch: prefer strscpy to strlcpy
Prefer strscpy over the deprecated strlcpy function. Link: https://lkml.kernel.org/r/19fe91084890e2c16fe56f960de6c570a93fa99b.camel@perches.com Signed-off-by: Joe Perches <joe@perches.com> Requested-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3a176b9460
commit
5dbdb2d87c
1 changed files with 6 additions and 0 deletions
|
@ -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
|
# typecasts on min/max could be min_t/max_t
|
||||||
if ($perl_version_ok &&
|
if ($perl_version_ok &&
|
||||||
defined $stat &&
|
defined $stat &&
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue