Skip to content

Commit

Permalink
checkpatch: refactor 'allowed asm includes' and add memory.h
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Wolfram Sang authored and Linus Torvalds committed Aug 10, 2010
1 parent 1986aaf commit 7840a94
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ sub help {
qr{fastcall},
);

our $allowed_asm_includes = qr{(?x:
irq|
memory
)};
# memory.h: ARM has a custom one

sub build_types {
my $mods = "(?x: \n" . join("|\n ", @modifierList) . "\n)";
my $all = "(?x: \n" . join("|\n ", @typeList) . "\n)";
Expand Down Expand Up @@ -2308,7 +2314,7 @@ sub process {
my $checkfile = "include/linux/$file";
if (-f "$root/$checkfile" &&
$realfile ne $checkfile &&
$1 ne 'irq')
$1 !~ /$allowed_asm_includes/)
{
if ($realfile =~ m{^arch/}) {
CHK("Consider using #include <linux/$file> instead of <asm/$file>\n" . $herecurr);
Expand Down

0 comments on commit 7840a94

Please sign in to comment.