diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0b40af57e71e..1054283c6e70 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -3931,6 +3931,19 @@ sub process { | |||
| 3931 | } | 3931 | } |
| 3932 | } | 3932 | } |
| 3933 | 3933 | ||
| 3934 | # don't use __constant_<foo> functions outside of include/uapi/ | ||
| 3935 | if ($realfile !~ m@^include/uapi/@ && | ||
| 3936 | $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) { | ||
| 3937 | my $constant_func = $1; | ||
| 3938 | my $func = $constant_func; | ||
| 3939 | $func =~ s/^__constant_//; | ||
| 3940 | if (WARN("CONSTANT_CONVERSION", | ||
| 3941 | "$constant_func should be $func\n" . $herecurr) && | ||
| 3942 | $fix) { | ||
| 3943 | $fixed[$linenr - 1] =~ s/\b$constant_func\b/$func/g; | ||
| 3944 | } | ||
| 3945 | } | ||
| 3946 | |||
| 3934 | # prefer usleep_range over udelay | 3947 | # prefer usleep_range over udelay |
| 3935 | if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { | 3948 | if ($line =~ /\budelay\s*\(\s*(\d+)\s*\)/) { |
| 3936 | my $delay = $1; | 3949 | my $delay = $1; |
