Commit 51b550a41c2ac0373b42f4e211f2df113b735b0a

Authored by Linus Torvalds

Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6

* 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
  export_report: use warn() to issue WARNING, so they go to stderr
  export_report: sort SECTION 2 output
  export_report: do collectcfiles work in perl itself
  kbuild: make versioncheck work in KBUILD_OUTDIR
  kbuild: make includecheck work in KBUILD_OUTDIR
  kbuild: make headerdep work in KBUILD_OUTDIR
  kbuild: add targets to PHONY
  kbuild: don't warn about include/linux/version.h not including itself
  eradicate bashisms in scripts/patch-kernel

Showing 4 changed files Side-by-side Diff

... ... @@ -1009,7 +1009,8 @@
1009 1009  
1010 1010 PHONY += headerdep
1011 1011 headerdep:
1012   - $(Q)find include/ -name '*.h' | xargs --max-args 1 scripts/headerdep.pl
  1012 + $(Q)find $(srctree)/include/ -name '*.h' | xargs --max-args 1 \
  1013 + $(srctree)/scripts/headerdep.pl -I$(srctree)/include
1013 1014  
1014 1015 # ---------------------------------------------------------------------------
1015 1016  
1016 1017  
1017 1018  
... ... @@ -1417,13 +1418,15 @@
1417 1418 # Scripts to check various things for consistency
1418 1419 # ---------------------------------------------------------------------------
1419 1420  
  1421 +PHONY += includecheck versioncheck coccicheck namespacecheck export_report
  1422 +
1420 1423 includecheck:
1421   - find * $(RCS_FIND_IGNORE) \
  1424 + find $(srctree)/* $(RCS_FIND_IGNORE) \
1422 1425 -name '*.[hcS]' -type f -print | sort \
1423 1426 | xargs $(PERL) -w $(srctree)/scripts/checkincludes.pl
1424 1427  
1425 1428 versioncheck:
1426   - find * $(RCS_FIND_IGNORE) \
  1429 + find $(srctree)/* $(RCS_FIND_IGNORE) \
1427 1430 -name '*.[hcS]' -type f -print | sort \
1428 1431 | xargs $(PERL) -w $(srctree)/scripts/checkversion.pl
1429 1432  
scripts/checkversion.pl
... ... @@ -12,6 +12,7 @@
12 12 my $debugging;
13 13  
14 14 foreach my $file (@ARGV) {
  15 + next if $file =~ "include/linux/version\.h";
15 16 # Open this file.
16 17 open( my $f, '<', $file )
17 18 or die "Can't open $file: $!\n";
scripts/export_report.pl
... ... @@ -25,11 +25,12 @@
25 25 sub print_depends_on {
26 26 my ($href) = @_;
27 27 print "\n";
28   - while (my ($mod, $list) = each %$href) {
  28 + for my $mod (sort keys %$href) {
  29 + my $list = $href->{$mod};
29 30 print "\t$mod:\n";
30 31 foreach my $sym (sort numerically @{$list}) {
31 32 my ($symbol, $no) = split /\s+/, $sym;
32   - printf("\t\t%-25s\t%-25d\n", $symbol, $no);
  33 + printf("\t\t%-25s\n", $symbol);
33 34 }
34 35 print "\n";
35 36 }
... ... @@ -49,8 +50,14 @@
49 50 }
50 51  
51 52 sub collectcfiles {
52   - my @file
53   - = `cat .tmp_versions/*.mod | grep '.*\.ko\$' | sed s/\.ko$/.mod.c/`;
  53 + my @file;
  54 + while (<.tmp_versions/*.mod>) {
  55 + open my $fh, '<', $_ or die "cannot open $_: $!\n";
  56 + push (@file,
  57 + grep s/\.ko/.mod.c/, # change the suffix
  58 + grep m/.+\.ko/, # find the .ko path
  59 + <$fh>); # lines in opened file
  60 + }
54 61 chomp @file;
55 62 return @file;
56 63 }
... ... @@ -95,6 +102,8 @@
95 102 #
96 103 # collect the usage count of each symbol.
97 104 #
  105 +my $modversion_warnings = 0;
  106 +
98 107 foreach my $thismod (@allcfiles) {
99 108 my $module;
100 109  
... ... @@ -125,7 +134,8 @@
125 134 }
126 135 }
127 136 if ($state != 2) {
128   - print "WARNING:$thismod is not built with CONFIG_MODVERSION enabled\n";
  137 + warn "WARNING:$thismod is not built with CONFIG_MODVERSIONS enabled\n";
  138 + $modversion_warnings++;
129 139 }
130 140 close($module);
131 141 }
132 142  
... ... @@ -159,8 +169,12 @@
159 169 modules. Each module lists the modules, and the symbols from that module that
160 170 it uses. Each listed symbol reports the number of modules using it\n");
161 171  
  172 +print "\nNOTE: Got $modversion_warnings CONFIG_MODVERSIONS warnings\n\n"
  173 + if $modversion_warnings;
  174 +
162 175 print "~"x80 , "\n";
163   -while (my ($thismod, $list) = each %MODULE) {
  176 +for my $thismod (sort keys %MODULE) {
  177 + my $list = $MODULE{$thismod};
164 178 my %depends;
165 179 $thismod =~ s/\.mod\.c/.ko/;
166 180 print "\t\t\t$thismod\n";
scripts/patch-kernel
... ... @@ -250,7 +250,7 @@
250 250 do
251 251 CURRENTFULLVERSION="$VERSION.$PATCHLEVEL.$SUBLEVEL"
252 252 EXTRAVER=
253   - if [ $STOPFULLVERSION = $CURRENTFULLVERSION ]; then
  253 + if [ x$STOPFULLVERSION = x$CURRENTFULLVERSION ]; then
254 254 echo "Stopping at $CURRENTFULLVERSION base as requested."
255 255 break
256 256 fi