diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/checkpatch.pl | 20 | ||||
| -rw-r--r-- | scripts/gen_initramfs_list.sh | 1 | ||||
| -rwxr-xr-x | scripts/get_maintainer.pl | 66 | ||||
| -rw-r--r-- | scripts/kconfig/streamline_config.pl | 9 |
4 files changed, 82 insertions, 14 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f2bbea90070..bd88f11b095 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -1382,6 +1382,21 @@ sub process { | |||
| 1382 | ERROR("trailing whitespace\n" . $herevet); | 1382 | ERROR("trailing whitespace\n" . $herevet); |
| 1383 | } | 1383 | } |
| 1384 | 1384 | ||
| 1385 | # check for Kconfig help text having a real description | ||
| 1386 | if ($realfile =~ /Kconfig/ && | ||
| 1387 | $line =~ /\+?\s*(---)?help(---)?$/) { | ||
| 1388 | my $length = 0; | ||
| 1389 | for (my $l = $linenr; defined($lines[$l]); $l++) { | ||
| 1390 | my $f = $lines[$l]; | ||
| 1391 | $f =~ s/#.*//; | ||
| 1392 | $f =~ s/^\s+//; | ||
| 1393 | next if ($f =~ /^$/); | ||
| 1394 | last if ($f =~ /^\s*config\s/); | ||
| 1395 | $length++; | ||
| 1396 | } | ||
| 1397 | WARN("please write a paragraph that describes the config symbol fully\n" . $herecurr) if ($length < 4); | ||
| 1398 | } | ||
| 1399 | |||
| 1385 | # check we are in a valid source file if not then ignore this hunk | 1400 | # check we are in a valid source file if not then ignore this hunk |
| 1386 | next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); | 1401 | next if ($realfile !~ /\.(h|c|s|S|pl|sh)$/); |
| 1387 | 1402 | ||
| @@ -2586,6 +2601,11 @@ sub process { | |||
| 2586 | CHK("architecture specific defines should be avoided\n" . $herecurr); | 2601 | CHK("architecture specific defines should be avoided\n" . $herecurr); |
| 2587 | } | 2602 | } |
| 2588 | 2603 | ||
| 2604 | # Check that the storage class is at the beginning of a declaration | ||
| 2605 | if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) { | ||
| 2606 | WARN("storage class should be at the beginning of the declaration\n" . $herecurr) | ||
| 2607 | } | ||
| 2608 | |||
| 2589 | # check the location of the inline attribute, that it is between | 2609 | # check the location of the inline attribute, that it is between |
| 2590 | # storage class and type. | 2610 | # storage class and type. |
| 2591 | if ($line =~ /\b$Type\s+$Inline\b/ || | 2611 | if ($line =~ /\b$Type\s+$Inline\b/ || |
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index 76af5f9623e..a932ae52f92 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh | |||
| @@ -242,6 +242,7 @@ case "$arg" in | |||
| 242 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f" | 242 | echo "$output_file" | grep -q "\.gz$" && compr="gzip -9 -f" |
| 243 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" | 243 | echo "$output_file" | grep -q "\.bz2$" && compr="bzip2 -9 -f" |
| 244 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" | 244 | echo "$output_file" | grep -q "\.lzma$" && compr="lzma -9 -f" |
| 245 | echo "$output_file" | grep -q "\.lzo$" && compr="lzop -9 -f" | ||
| 245 | echo "$output_file" | grep -q "\.cpio$" && compr="cat" | 246 | echo "$output_file" | grep -q "\.cpio$" && compr="cat" |
| 246 | shift | 247 | shift |
| 247 | ;; | 248 | ;; |
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index 6f97a13bcee..b2281982f52 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | use strict; | 13 | use strict; |
| 14 | 14 | ||
| 15 | my $P = $0; | 15 | my $P = $0; |
| 16 | my $V = '0.23'; | 16 | my $V = '0.24'; |
| 17 | 17 | ||
| 18 | use Getopt::Long qw(:config no_auto_abbrev); | 18 | use Getopt::Long qw(:config no_auto_abbrev); |
| 19 | 19 | ||
| @@ -25,6 +25,7 @@ my $email_list = 1; | |||
| 25 | my $email_subscriber_list = 0; | 25 | my $email_subscriber_list = 0; |
| 26 | my $email_git_penguin_chiefs = 0; | 26 | my $email_git_penguin_chiefs = 0; |
| 27 | my $email_git = 1; | 27 | my $email_git = 1; |
| 28 | my $email_git_all_signature_types = 0; | ||
| 28 | my $email_git_blame = 0; | 29 | my $email_git_blame = 0; |
| 29 | my $email_git_min_signatures = 1; | 30 | my $email_git_min_signatures = 1; |
| 30 | my $email_git_max_maintainers = 5; | 31 | my $email_git_max_maintainers = 5; |
| @@ -51,9 +52,9 @@ my $help = 0; | |||
| 51 | my $exit = 0; | 52 | my $exit = 0; |
| 52 | 53 | ||
| 53 | my @penguin_chief = (); | 54 | my @penguin_chief = (); |
| 54 | push(@penguin_chief,"Linus Torvalds:torvalds\@linux-foundation.org"); | 55 | push(@penguin_chief, "Linus Torvalds:torvalds\@linux-foundation.org"); |
| 55 | #Andrew wants in on most everything - 2009/01/14 | 56 | #Andrew wants in on most everything - 2009/01/14 |
| 56 | #push(@penguin_chief,"Andrew Morton:akpm\@linux-foundation.org"); | 57 | #push(@penguin_chief, "Andrew Morton:akpm\@linux-foundation.org"); |
| 57 | 58 | ||
| 58 | my @penguin_chief_names = (); | 59 | my @penguin_chief_names = (); |
| 59 | foreach my $chief (@penguin_chief) { | 60 | foreach my $chief (@penguin_chief) { |
| @@ -63,7 +64,16 @@ foreach my $chief (@penguin_chief) { | |||
| 63 | push(@penguin_chief_names, $chief_name); | 64 | push(@penguin_chief_names, $chief_name); |
| 64 | } | 65 | } |
| 65 | } | 66 | } |
| 66 | my $penguin_chiefs = "\(" . join("|",@penguin_chief_names) . "\)"; | 67 | my $penguin_chiefs = "\(" . join("|", @penguin_chief_names) . "\)"; |
| 68 | |||
| 69 | # Signature types of people who are either | ||
| 70 | # a) responsible for the code in question, or | ||
| 71 | # b) familiar enough with it to give relevant feedback | ||
| 72 | my @signature_tags = (); | ||
| 73 | push(@signature_tags, "Signed-off-by:"); | ||
| 74 | push(@signature_tags, "Reviewed-by:"); | ||
| 75 | push(@signature_tags, "Acked-by:"); | ||
| 76 | my $signaturePattern = "\(" . join("|", @signature_tags) . "\)"; | ||
| 67 | 77 | ||
| 68 | # rfc822 email address - preloaded methods go here. | 78 | # rfc822 email address - preloaded methods go here. |
| 69 | my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])"; | 79 | my $rfc822_lwsp = "(?:(?:\\r\\n)?[ \\t])"; |
| @@ -97,9 +107,34 @@ my %VCS_cmds_hg = ( | |||
| 97 | "blame_commit_pattern" => "^([0-9a-f]+):" | 107 | "blame_commit_pattern" => "^([0-9a-f]+):" |
| 98 | ); | 108 | ); |
| 99 | 109 | ||
| 110 | if (-f "${lk_path}.get_maintainer.conf") { | ||
| 111 | my @conf_args; | ||
| 112 | open(my $conffile, '<', "${lk_path}.get_maintainer.conf") | ||
| 113 | or warn "$P: Can't open .get_maintainer.conf: $!\n"; | ||
| 114 | while (<$conffile>) { | ||
| 115 | my $line = $_; | ||
| 116 | |||
| 117 | $line =~ s/\s*\n?$//g; | ||
| 118 | $line =~ s/^\s*//g; | ||
| 119 | $line =~ s/\s+/ /g; | ||
| 120 | |||
| 121 | next if ($line =~ m/^\s*#/); | ||
| 122 | next if ($line =~ m/^\s*$/); | ||
| 123 | |||
| 124 | my @words = split(" ", $line); | ||
| 125 | foreach my $word (@words) { | ||
| 126 | last if ($word =~ m/^#/); | ||
| 127 | push (@conf_args, $word); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | close($conffile); | ||
| 131 | unshift(@ARGV, @conf_args) if @conf_args; | ||
| 132 | } | ||
| 133 | |||
| 100 | if (!GetOptions( | 134 | if (!GetOptions( |
| 101 | 'email!' => \$email, | 135 | 'email!' => \$email, |
| 102 | 'git!' => \$email_git, | 136 | 'git!' => \$email_git, |
| 137 | 'git-all-signature-types!' => \$email_git_all_signature_types, | ||
| 103 | 'git-blame!' => \$email_git_blame, | 138 | 'git-blame!' => \$email_git_blame, |
| 104 | 'git-chief-penguins!' => \$email_git_penguin_chiefs, | 139 | 'git-chief-penguins!' => \$email_git_penguin_chiefs, |
| 105 | 'git-min-signatures=i' => \$email_git_min_signatures, | 140 | 'git-min-signatures=i' => \$email_git_min_signatures, |
| @@ -180,6 +215,10 @@ if (!top_of_kernel_tree($lk_path)) { | |||
| 180 | . "a linux kernel source tree.\n"; | 215 | . "a linux kernel source tree.\n"; |
| 181 | } | 216 | } |
| 182 | 217 | ||
| 218 | if ($email_git_all_signature_types) { | ||
| 219 | $signaturePattern = "(.+?)[Bb][Yy]:"; | ||
| 220 | } | ||
| 221 | |||
| 183 | ## Read MAINTAINERS for type/value pairs | 222 | ## Read MAINTAINERS for type/value pairs |
| 184 | 223 | ||
| 185 | my @typevalue = (); | 224 | my @typevalue = (); |
| @@ -497,13 +536,15 @@ version: $V | |||
| 497 | MAINTAINER field selection options: | 536 | MAINTAINER field selection options: |
| 498 | --email => print email address(es) if any | 537 | --email => print email address(es) if any |
| 499 | --git => include recent git \*-by: signers | 538 | --git => include recent git \*-by: signers |
| 539 | --git-all-signature-types => include signers regardless of signature type | ||
| 540 | or use only ${signaturePattern} signers (default: $email_git_all_signature_types) | ||
| 500 | --git-chief-penguins => include ${penguin_chiefs} | 541 | --git-chief-penguins => include ${penguin_chiefs} |
| 501 | --git-min-signatures => number of signatures required (default: 1) | 542 | --git-min-signatures => number of signatures required (default: $email_git_min_signatures) |
| 502 | --git-max-maintainers => maximum maintainers to add (default: 5) | 543 | --git-max-maintainers => maximum maintainers to add (default: $email_git_max_maintainers) |
| 503 | --git-min-percent => minimum percentage of commits required (default: 5) | 544 | --git-min-percent => minimum percentage of commits required (default: $email_git_min_percent) |
| 504 | --git-blame => use git blame to find modified commits for patch or file | 545 | --git-blame => use git blame to find modified commits for patch or file |
| 505 | --git-since => git history to use (default: 1-year-ago) | 546 | --git-since => git history to use (default: $email_git_since) |
| 506 | --hg-since => hg history to use (default: -365) | 547 | --hg-since => hg history to use (default: $email_hg_since) |
| 507 | --m => include maintainer(s) if any | 548 | --m => include maintainer(s) if any |
| 508 | --n => include name 'Full Name <addr\@domain.tld>' | 549 | --n => include name 'Full Name <addr\@domain.tld>' |
| 509 | --l => include list(s) if any | 550 | --l => include list(s) if any |
| @@ -556,6 +597,11 @@ Notes: | |||
| 556 | --git-min-signatures, --git-max-maintainers, --git-min-percent, and | 597 | --git-min-signatures, --git-max-maintainers, --git-min-percent, and |
| 557 | --git-blame | 598 | --git-blame |
| 558 | Use --hg-since not --git-since to control date selection | 599 | Use --hg-since not --git-since to control date selection |
| 600 | File ".get_maintainer.conf", if it exists in the linux kernel source root | ||
| 601 | directory, can change whatever get_maintainer defaults are desired. | ||
| 602 | Entries in this file can be any command line argument. | ||
| 603 | This file is prepended to any additional command line arguments. | ||
| 604 | Multiple lines and # comments are allowed. | ||
| 559 | EOT | 605 | EOT |
| 560 | } | 606 | } |
| 561 | 607 | ||
| @@ -964,7 +1010,7 @@ sub vcs_find_signers { | |||
| 964 | 1010 | ||
| 965 | $commits = grep(/$pattern/, @lines); # of commits | 1011 | $commits = grep(/$pattern/, @lines); # of commits |
| 966 | 1012 | ||
| 967 | @lines = grep(/^[-_ a-z]+by:.*\@.*$/i, @lines); | 1013 | @lines = grep(/^[ \t]*${signaturePattern}.*\@.*$/, @lines); |
| 968 | if (!$email_git_penguin_chiefs) { | 1014 | if (!$email_git_penguin_chiefs) { |
| 969 | @lines = grep(!/${penguin_chiefs}/i, @lines); | 1015 | @lines = grep(!/${penguin_chiefs}/i, @lines); |
| 970 | } | 1016 | } |
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index afbd54ac1d8..c70a27d924f 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl | |||
| @@ -115,7 +115,9 @@ my $ksource = $ARGV[0]; | |||
| 115 | my $kconfig = $ARGV[1]; | 115 | my $kconfig = $ARGV[1]; |
| 116 | my $lsmod_file = $ARGV[2]; | 116 | my $lsmod_file = $ARGV[2]; |
| 117 | 117 | ||
| 118 | my @makefiles = `find $ksource -name Makefile`; | 118 | my @makefiles = `find $ksource -name Makefile 2>/dev/null`; |
| 119 | chomp @makefiles; | ||
| 120 | |||
| 119 | my %depends; | 121 | my %depends; |
| 120 | my %selects; | 122 | my %selects; |
| 121 | my %prompts; | 123 | my %prompts; |
| @@ -215,7 +217,6 @@ if ($kconfig) { | |||
| 215 | 217 | ||
| 216 | # Read all Makefiles to map the configs to the objects | 218 | # Read all Makefiles to map the configs to the objects |
| 217 | foreach my $makefile (@makefiles) { | 219 | foreach my $makefile (@makefiles) { |
| 218 | chomp $makefile; | ||
| 219 | 220 | ||
| 220 | open(MIN,$makefile) || die "Can't open $makefile"; | 221 | open(MIN,$makefile) || die "Can't open $makefile"; |
| 221 | while (<MIN>) { | 222 | while (<MIN>) { |
| @@ -242,7 +243,7 @@ foreach my $makefile (@makefiles) { | |||
| 242 | foreach my $obj (split /\s+/,$objs) { | 243 | foreach my $obj (split /\s+/,$objs) { |
| 243 | $obj =~ s/-/_/g; | 244 | $obj =~ s/-/_/g; |
| 244 | if ($obj =~ /(.*)\.o$/) { | 245 | if ($obj =~ /(.*)\.o$/) { |
| 245 | # Objects may bes enabled by more than one config. | 246 | # Objects may be enabled by more than one config. |
| 246 | # Store configs in an array. | 247 | # Store configs in an array. |
| 247 | my @arr; | 248 | my @arr; |
| 248 | 249 | ||
| @@ -307,7 +308,7 @@ close (LIN); | |||
| 307 | my %configs; | 308 | my %configs; |
| 308 | foreach my $module (keys(%modules)) { | 309 | foreach my $module (keys(%modules)) { |
| 309 | if (defined($objects{$module})) { | 310 | if (defined($objects{$module})) { |
| 310 | @arr = @{$objects{$module}}; | 311 | my @arr = @{$objects{$module}}; |
| 311 | foreach my $conf (@arr) { | 312 | foreach my $conf (@arr) { |
| 312 | $configs{$conf} = $module; | 313 | $configs{$conf} = $module; |
| 313 | } | 314 | } |
