diff options
-rwxr-xr-x | scripts/checkpatch.pl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 78a951f80706..28516587baba 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -4791,6 +4791,16 @@ sub process { | |||
4791 | } | 4791 | } |
4792 | } | 4792 | } |
4793 | 4793 | ||
4794 | # check for __read_mostly with const non-pointer (should just be const) | ||
4795 | if ($line =~ /\b__read_mostly\b/ && | ||
4796 | $line =~ /($Type)\s*$Ident/ && $1 !~ /\*\s*$/ && $1 =~ /\bconst\b/) { | ||
4797 | if (ERROR("CONST_READ_MOSTLY", | ||
4798 | "Invalid use of __read_mostly with const type\n" . $herecurr) && | ||
4799 | $fix) { | ||
4800 | $fixed[$fixlinenr] =~ s/\s+__read_mostly\b//; | ||
4801 | } | ||
4802 | } | ||
4803 | |||
4794 | # don't use __constant_<foo> functions outside of include/uapi/ | 4804 | # don't use __constant_<foo> functions outside of include/uapi/ |
4795 | if ($realfile !~ m@^include/uapi/@ && | 4805 | if ($realfile !~ m@^include/uapi/@ && |
4796 | $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) { | 4806 | $line =~ /(__constant_(?:htons|ntohs|[bl]e(?:16|32|64)_to_cpu|cpu_to_[bl]e(?:16|32|64)))\s*\(/) { |