]>
git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blob - scripts/headers_check.pl
3 # headers_check.pl execute a number of trivial consistency checks
5 # Usage: headers_check.pl dir [files...]
6 # dir: dir to look for included files
8 # files: list of files to check
10 # The script reads the supplied files line by line and:
12 # 1) for each include statement it checks if the
13 # included file actually exists.
14 # Only include files located in asm* and linux* are checked.
15 # The rest are assumed to be system include files.
17 # 2) TODO: check for leaked CONFIG_ symbols
22 my ($dir, $arch, @files) = @ARGV;
29 foreach my $file (@files) {
31 open(my $fh, '<', "$filename") or die "$filename: $!\n";
33 while ($line = <$fh>) {
43 if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) {
46 $found = stat($dir . "/" . $inc);
48 $inc =~ s
#asm/#asm-$arch/#;
49 $found = stat($dir . "/" . $inc);
52 printf STDERR
"$filename:$lineno: included file '$inc' is not exported\n";