| # headers_check.pl execute a number of trivial consistency checks |
| # Usage: headers_check.pl dir [files...] |
| # dir: dir to look for included files |
| # 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 |
| my ($dir, $arch, @files) = @ARGV; |
| foreach my $file (@files) { |
| open(FH, "<$filename") or die "$filename: $!\n"; |
| if ($line =~ m/^\s*#\s*include\s+<((asm|linux).*)>/) { |
| $found = stat($dir . "/" . $inc); |
| $inc =~ s#asm/#asm-$arch/#; |
| $found = stat($dir . "/" . $inc); |
| printf STDERR "$filename:$lineno: included file '$inc' is not exported\n"; |