Change the check suggesting replacement of asm-includes with linux-includes. Exceptions to this rule are easier to extend now. Add memory.h because ARM has a custom one.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -224,6 +224,12 @@ our @modifierList = ( · 223 unmodified lines | ||
| 224 | 224 | qr{fastcall}, |
| 225 | 225 | ); |
| 226 | 226 | |
| 227 | +our $allowed_asm_includes = qr{(?x: | |
| 228 | + irq| | |
| 229 | + memory | |
| 230 | +)}; | |
| 231 | +# memory.h: ARM has a custom one | |
| 232 | + | |
| 227 | 233 | sub build_types { |
| 228 | 234 | my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)"; |
| 229 | 235 | my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)"; |
| @@ -2308,7 +2314,7 @@ sub process { · 2078 unmodified lines | ||
| 2308 | 2314 | my $checkfile = "include/linux/$file"; |
| 2309 | 2315 | if (-f "$root/$checkfile" && |
| 2310 | 2316 | $realfile ne $checkfile && |
| 2311 | − $1 ne 'irq') | |
| 2317 | + $1 !~ /$allowed_asm_includes/) | |
| 2312 | 2318 | { |
| 2313 | 2319 | if ($realfile =~ m{^arch/}) { |
| 2314 | 2320 | CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr); |