summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a81fc66e62cc..dfeb553de798 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -5149,9 +5149,10 @@ sub process {
5149 5149
5150# Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar) 5150# Check for memcpy(foo, bar, ETH_ALEN) that could be ether_addr_copy(foo, bar)
5151 if ($^V && $^V ge 5.10.0 && 5151 if ($^V && $^V ge 5.10.0 &&
5152 $line =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/s) { 5152 defined $stat &&
5153 $stat =~ /^\+(?:.*?)\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) {
5153 if (WARN("PREFER_ETHER_ADDR_COPY", 5154 if (WARN("PREFER_ETHER_ADDR_COPY",
5154 "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)\n" . $herecurr) && 5155 "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)\n" . "$here\n$stat\n") &&
5155 $fix) { 5156 $fix) {
5156 $fixed[$fixlinenr] =~ s/\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/ether_addr_copy($2, $7)/; 5157 $fixed[$fixlinenr] =~ s/\bmemcpy\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/ether_addr_copy($2, $7)/;
5157 } 5158 }