aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-03-24 02:17:25 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-03-24 02:17:25 -0400
commita3d3362287fbe96fe90abdb5c6d1a35471129a8c (patch)
treead3c85ed1feef470c66599eb514e30f43c2db5dd /scripts
parentfb7f045ace0624f1e59a7db8497e460bd54b1cbc (diff)
parent4bbba111d94781d34081c37856bbc5eb33f6c72a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into sh-latest
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bloat-o-meter4
-rwxr-xr-xscripts/checkpatch.pl10
-rwxr-xr-xscripts/get_maintainer.pl11
3 files changed, 21 insertions, 4 deletions
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter
index 6501a50e17f0..6129020c41a9 100755
--- a/scripts/bloat-o-meter
+++ b/scripts/bloat-o-meter
@@ -17,7 +17,9 @@ def getsizes(file):
17 sym = {} 17 sym = {}
18 for l in os.popen("nm --size-sort " + file).readlines(): 18 for l in os.popen("nm --size-sort " + file).readlines():
19 size, type, name = l[:-1].split() 19 size, type, name = l[:-1].split()
20 if type in "tTdDbB": 20 if type in "tTdDbBrR":
21 # strip generated symbols
22 if name[:6] == "__mod_": continue
21 # function names begin with '.' on 64-bit powerpc 23 # function names begin with '.' on 64-bit powerpc
22 if "." in name[1:]: name = "static." + name.split(".")[0] 24 if "." in name[1:]: name = "static." + name.split(".")[0]
23 sym[name] = sym.get(name, 0) + int(size, 16) 25 sym[name] = sym.get(name, 0) + int(size, 16)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 58848e3e392c..8f9e394298cd 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2804,9 +2804,9 @@ sub process {
2804 WARN("consider using a completion\n" . $herecurr); 2804 WARN("consider using a completion\n" . $herecurr);
2805 2805
2806 } 2806 }
2807# recommend strict_strto* over simple_strto* 2807# recommend kstrto* over simple_strto*
2808 if ($line =~ /\bsimple_(strto.*?)\s*\(/) { 2808 if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
2809 WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); 2809 WARN("consider using kstrto* in preference to simple_$1\n" . $herecurr);
2810 } 2810 }
2811# check for __initcall(), use device_initcall() explicitly please 2811# check for __initcall(), use device_initcall() explicitly please
2812 if ($line =~ /^.\s*__initcall\s*\(/) { 2812 if ($line =~ /^.\s*__initcall\s*\(/) {
@@ -2902,6 +2902,11 @@ sub process {
2902 $line =~ /DEVICE_ATTR.*S_IWUGO/ ) { 2902 $line =~ /DEVICE_ATTR.*S_IWUGO/ ) {
2903 WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr); 2903 WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
2904 } 2904 }
2905
2906 # Check for memset with swapped arguments
2907 if ($line =~ /memset.*\,(\ |)(0x|)0(\ |0|)\);/) {
2908 ERROR("memset size is 3rd argument, not the second.\n" . $herecurr);
2909 }
2905 } 2910 }
2906 2911
2907 # If we have no input at all, then there is nothing to report on 2912 # If we have no input at all, then there is nothing to report on
@@ -2944,6 +2949,7 @@ sub process {
2944 if ($rpt_cleaners) { 2949 if ($rpt_cleaners) {
2945 print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n"; 2950 print "NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or\n";
2946 print " scripts/cleanfile\n\n"; 2951 print " scripts/cleanfile\n\n";
2952 $rpt_cleaners = 0;
2947 } 2953 }
2948 } 2954 }
2949 2955
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl
index 139e0fff8e31..d29a8d75cb22 100755
--- a/scripts/get_maintainer.pl
+++ b/scripts/get_maintainer.pl
@@ -420,6 +420,14 @@ foreach my $file (@ARGV) {
420 420
421 open(my $patch, "< $file") 421 open(my $patch, "< $file")
422 or die "$P: Can't open $file: $!\n"; 422 or die "$P: Can't open $file: $!\n";
423
424 # We can check arbitrary information before the patch
425 # like the commit message, mail headers, etc...
426 # This allows us to match arbitrary keywords against any part
427 # of a git format-patch generated file (subject tags, etc...)
428
429 my $patch_prefix = ""; #Parsing the intro
430
423 while (<$patch>) { 431 while (<$patch>) {
424 my $patch_line = $_; 432 my $patch_line = $_;
425 if (m/^\+\+\+\s+(\S+)/) { 433 if (m/^\+\+\+\s+(\S+)/) {
@@ -428,13 +436,14 @@ foreach my $file (@ARGV) {
428 $filename =~ s@\n@@; 436 $filename =~ s@\n@@;
429 $lastfile = $filename; 437 $lastfile = $filename;
430 push(@files, $filename); 438 push(@files, $filename);
439 $patch_prefix = "^[+-].*"; #Now parsing the actual patch
431 } elsif (m/^\@\@ -(\d+),(\d+)/) { 440 } elsif (m/^\@\@ -(\d+),(\d+)/) {
432 if ($email_git_blame) { 441 if ($email_git_blame) {
433 push(@range, "$lastfile:$1:$2"); 442 push(@range, "$lastfile:$1:$2");
434 } 443 }
435 } elsif ($keywords) { 444 } elsif ($keywords) {
436 foreach my $line (keys %keyword_hash) { 445 foreach my $line (keys %keyword_hash) {
437 if ($patch_line =~ m/^[+-].*$keyword_hash{$line}/x) { 446 if ($patch_line =~ m/${patch_prefix}$keyword_hash{$line}/x) {
438 push(@keyword_tvi, $line); 447 push(@keyword_tvi, $line);
439 } 448 }
440 } 449 }