https://github.com/torvalds/linux
Revision a814917058a63978ecd9fbefe4f88e3fc1576a79 authored by Russell King on 27 August 2008, 13:29:40 UTC, committed by Russell King on 27 August 2008, 15:15:23 UTC
Taken from omap 97b705ad835f1481270c4b67b402d6e37fa8ad15:
  ARM: OMAP: Misc compile fixes after syncing with mainline

  Also fix 2430 smc91x to use IRQ_LOWLEVEL.

  Signed-off-by: Tony Lindgren <tony@atomide.com>

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 9c2d015
Raw File
Tip revision: a814917058a63978ecd9fbefe4f88e3fc1576a79 authored by Russell King on 27 August 2008, 13:29:40 UTC
[ARM] OMAP: Fix 2430 SMC91x ethernet IRQ
Tip revision: a814917
headers_check.pl
#!/usr/bin/perl
#
# headers_check.pl execute a number of trivial consistency checks
#
# Usage: headers_check.pl dir [files...]
# dir:   dir to look for included files
# arch:  architecture
# files: list of files to check
#
# The script reads the supplied files line by line and:
#
# 1) for each include statement it checks if the
#    included file actually exists.
#    Only include files located in asm* and linux* are checked.
#    The rest are assumed to be system include files.
#
# 2) TODO: check for leaked CONFIG_ symbols

use strict;
use warnings;

my ($dir, $arch, @files) = @ARGV;

my $ret = 0;
my $line;
my $lineno = 0;
my $filename;

foreach my $file (@files) {
	$filename = $file;
	open(my $fh, '<', "$filename") or die "$filename: $!\n";
	$lineno = 0;
	while ($line = <$fh>) {
		$lineno++;
		check_include();
	}
	close $fh;
}
exit $ret;

sub check_include
{
	if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) {
		my $inc = $1;
		my $found;
		$found = stat($dir . "/" . $inc);
		if (!$found) {
			$inc =~ s#asm/#asm-$arch/#;
			$found = stat($dir . "/" . $inc);
		}
		if (!$found) {
			printf STDERR "$filename:$lineno: included file '$inc' is not exported\n";
			$ret = 1;
		}
	}
}
back to top