diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 69c4716d9e27..f04fe88d998d 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -5157,6 +5157,14 @@ sub process { | |||
| 5157 | } | 5157 | } |
| 5158 | } | 5158 | } |
| 5159 | 5159 | ||
| 5160 | # Check for memcmp(foo, bar, ETH_ALEN) that could be ether_addr_equal*(foo, bar) | ||
| 5161 | if ($^V && $^V ge 5.10.0 && | ||
| 5162 | defined $stat && | ||
| 5163 | $stat =~ /^\+(?:.*?)\bmemcmp\s*\(\s*$FuncArg\s*,\s*$FuncArg\s*\,\s*ETH_ALEN\s*\)/) { | ||
| 5164 | WARN("PREFER_ETHER_ADDR_EQUAL", | ||
| 5165 | "Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()\n" . "$here\n$stat\n") | ||
| 5166 | } | ||
| 5167 | |||
| 5160 | # typecasts on min/max could be min_t/max_t | 5168 | # typecasts on min/max could be min_t/max_t |
| 5161 | if ($^V && $^V ge 5.10.0 && | 5169 | if ($^V && $^V ge 5.10.0 && |
| 5162 | defined $stat && | 5170 | defined $stat && |
